編函數 float fun(double h),函數的功能是:對變量h中的值保留兩位小數,并對第三位進行四舍五入(規定h中的值為正數)。 例如:若h 值為8.32433,則函數返回8.32 若h值為8.32533,則函數返回8.33。
上傳時間: 2017-06-10
上傳用戶:zsjinju
數學函數,所在函數庫為math.h、stdlib.h、string.h、float.h
上傳時間: 2014-01-15
上傳用戶:xauthu
Simple class to read from keyboard. Already convert to simple type int, float, double or String
標簽: keyboard Already convert Simple
上傳時間: 2013-12-18
上傳用戶:wangdean1101
Lots useful AVR asm math routines (trigonometry, float point, intenger , vectors and etc)
標簽: trigonometry intenger routines vectors
上傳時間: 2017-09-08
上傳用戶:AbuGe
Flying™ RTK Solution as Effective Enhancement of Conventional float RTKDmitry Kozlov, Gleb ZyryanovMagellan, Russia
標簽: Conventional Enhancement Effective RTK
上傳時間: 2017-09-09
上傳用戶:ouyangtongze
The LTC®4155 and LTC4156 are dual multiplexed-inputbattery chargers with PowerPath™ control, featuring I2Cprogrammability and USB On-The-Go for systems suchas tablet PCs and other high power density applications.The LTC4155’s float voltage (Vfloat) range is optimizedfor Li-Ion batteries, while the LTC4156 is optimized forlithium iron phosphate (LiFePO4)batteries, supportingsystem loads to 4A with up to 3.5A of battery chargecurrent. I2C controls a broad range of functions and USBOn-The-Go functionality is controlled directly from theUSB connector ID pin.
上傳時間: 2013-10-09
上傳用戶:hanhanj
TLC2543是TI公司的12位串行模數轉換器,使用開關電容逐次逼近技術完成A/D轉換過程。由于是串行輸入結構,能夠節省51系列單片機I/O資源;且價格適中,分辨率較高,因此在儀器儀表中有較為廣泛的應用。 TLC2543的特點 (1)12位分辯率A/D轉換器; (2)在工作溫度范圍內10μs轉換時間; (3)11個模擬輸入通道; (4)3路內置自測試方式; (5)采樣率為66kbps; (6)線性誤差±1LSBmax; (7)有轉換結束輸出EOC; (8)具有單、雙極性輸出; (9)可編程的MSB或LSB前導; (10)可編程輸出數據長度。 TLC2543的引腳排列及說明 TLC2543有兩種封裝形式:DB、DW或N封裝以及FN封裝,這兩種封裝的引腳排列如圖1,引腳說明見表1 TLC2543電路圖和程序欣賞 #include<reg52.h> #include<intrins.h> #define uchar unsigned char #define uint unsigned int sbit clock=P1^0; sbit d_in=P1^1; sbit d_out=P1^2; sbit _cs=P1^3; uchar a1,b1,c1,d1; float sum,sum1; double sum_final1; double sum_final; uchar duan[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; uchar wei[]={0xf7,0xfb,0xfd,0xfe}; void delay(unsigned char b) //50us { unsigned char a; for(;b>0;b--) for(a=22;a>0;a--); } void display(uchar a,uchar b,uchar c,uchar d) { P0=duan[a]|0x80; P2=wei[0]; delay(5); P2=0xff; P0=duan[b]; P2=wei[1]; delay(5); P2=0xff; P0=duan[c]; P2=wei[2]; delay(5); P2=0xff; P0=duan[d]; P2=wei[3]; delay(5); P2=0xff; } uint read(uchar port) { uchar i,al=0,ah=0; unsigned long ad; clock=0; _cs=0; port<<=4; for(i=0;i<4;i++) { d_in=port&0x80; clock=1; clock=0; port<<=1; } d_in=0; for(i=0;i<8;i++) { clock=1; clock=0; } _cs=1; delay(5); _cs=0; for(i=0;i<4;i++) { clock=1; ah<<=1; if(d_out)ah|=0x01; clock=0; } for(i=0;i<8;i++) { clock=1; al<<=1; if(d_out) al|=0x01; clock=0; } _cs=1; ad=(uint)ah; ad<<=8; ad|=al; return(ad); } void main() { uchar j; sum=0;sum1=0; sum_final=0; sum_final1=0; while(1) { for(j=0;j<128;j++) { sum1+=read(1); display(a1,b1,c1,d1); } sum=sum1/128; sum1=0; sum_final1=(sum/4095)*5; sum_final=sum_final1*1000; a1=(int)sum_final/1000; b1=(int)sum_final%1000/100; c1=(int)sum_final%1000%100/10; d1=(int)sum_final%10; display(a1,b1,c1,d1); } }
上傳時間: 2013-11-19
上傳用戶:shen1230
keil 使用筆記:在Memory窗口上輸入address_type:address才能看到正確地址的變量debug~perfermance analyzer加入要察看的模塊名稱,然后view~perfermance analyzer window 可以察看各個模塊運行時間①Display address_type:address B:Bit address C:Code Memory Bx:Code Bank D D:80H 命令可以查看特殊寄存器 data D I:0 命令可以查看內部RAM數據iData; D X:0 命令可以查看外部RAM數據xData; ②R1 //顯示R1 register ~R1 //顯示變量R1 R1 = R7 //對寄存器Rx操作R1 = --R7 R1 = 0x20 ③main //顯示main()的開始地址d main //顯示main()的代碼④向RAM.ROM中寫數據Enter data_type address_type:address expr,expr.... data_type:int char double float long E char data:0x20 1,2,3,4 //向data區0x20開始的地址寫1,2,3,4 變量放在RAM的30H,要把定義放在main前面!另外特別注意,內部RAM通常供C程序存放中間變量等,所以一定要看看編譯后的程序中是否存在存儲單元沖突的情況,比如如果程序中 使用了別的寄存器組的話,08-1FH單元就不能用了unsigned long data i _at_ 0x30
上傳時間: 2013-11-05
上傳用戶:dongqiangqiang
數據類型和運算符、表達式是是C51語言程序設計的最基礎知識,C51語言把數據分成了多種數據類型,并提供了豐富的運算對數據進行處理。本章對C51語言的基本數據類型、常量變量、運算符及表達式等進行詳細介紹。1.掌握數據類型的概念,了解C51語言能夠處理的數據類型。2.掌握常量的概念,掌握各種類型常量的特點及表示形式。3.掌握變量的概念,了解int、float、char型變量的特點,掌握這三種類型變量的定義、賦值和使用方法。理解C51中變量的存儲和編譯模式的關系,掌握單片機片內資源的訪問方法。4.了解C51語言的基本運算符及其特點,掌握運算符的優先級和結合性的概念。5.了解算術運算表達式、關系表達式及邏輯表達式的特點,熟練進行表達式計算,能熟練進行實際問題的表達式描述。6.熟悉自增、自減運算的特點,掌握賦值運算,了解逗號運算符和逗號表達式。7.掌握數據類型轉換的概念,能進行基本的數據類型轉換。
標簽: C51
上傳時間: 2013-12-26
上傳用戶:dingdingcandy
單片機接口技術(C51版)課件:單片機接口技術(C51版)課件精品課程,該書由張道德根據多年單片機教學、科研經驗編著,中國水利水電出版社2007年3月出版。 1.掌握數據類型的概念,了解C51語言能夠處理的數據類型。2.掌握常量的概念,掌握各種類型常量的特點及表示形式。3.掌握變量的概念,了解int、float、char型變量的特點,掌握這三種類型變量的定義、賦值和使用方法。理解C51中變量的存儲和編譯模式的關系,掌握單片機片內資源的訪問方法。4.了解C51語言的基本運算符及其特點,掌握運算符的優先級和結合性的概念。5.了解算術運算表達式、關系表達式及邏輯表達式的特點,熟練進行表達式計算,能熟練進行實際問題的表達式描述。6.熟悉自增、自減運算的特點,掌握賦值運算,了解逗號運算符和逗號表達式。7.掌握數據類型轉換的概念,能進行基本的數據類型轉換。
上傳時間: 2013-10-10
上傳用戶:jcljkh