资源描述:
《温度显示的程序之一》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、// // // // Function: TestTemperature.-30~+105 // // UsedEquation // // RT/R25=e(B*((1/(T+273))-(1/298))) // // // // ChangeList: V0.9->V0.91 (07,02) // // ChangedisplayAerror // // // // V0.91->V0.92 (07,03) // // AddT
2、empTabjiaozheng70~100C // // // //******************************************************// #include "ADUC812.h" #include "math.h" #include "intrins.h" #include "string.h" #include "stdio.h" #include "dada.h" bdataunsignedcharLCD_data[8];
3、 //**DisplayBuffer**// int ssdata[3]; #define Temp_100 235 #define Temp_40 1352 sbit s_data =P2^0; //**LCDSerialDataPort**// sbit clk_lcd=P2^2; //**LCDClockPort**// sbit lcd_cs =P2^1; //**LCDChipSelectPort**// sbit led
4、 =P2^7; //**********LCDCommandNameDefine***********// #definecmd_off0x00 //**LCDControlPowerDown**// #definecmd_on0x01 //**LCDControlPowerUp**// #definecmd_LCD_off0x02 //**CloseLCD**// #definecmd_LCD_on0x03 //*
5、*OpenLCD**// #definecmd_LCD_B3C40x29 //**LCDMode1/3BAIS,1/4DUTY**// #definecmd_LCD_RC0x18 //**LCDControlInternalOscillator256K**// // dataunsignedcharComm_buff[16]; //**SerialPortReceiverBuffer**// //dataunsignedcharComm_len; /
6、/**SerialPortReceiverDataLength**// //bitComm_ready; //**SerialPortReceiverFlag**// //**LCDCode0,1,2...A,B,F,0.,1.,...A.,B.,F.**// unsignedcharcodeLCD_code[]= { 0xeb,0x60,0xc7,0xe5,0x6c,0xad,0xaf,0xe0,0xef,0xed,0xee,0x2F,0x8b,0x67,0x8F,
7、0x8e, 0xfb,0x70,0xd7,0xf5,0x7c,0xbd,0xbf,0xf0,0xff,0xfd,0xfe,0x3f,0x9b,0x77,0x9f,0x9e, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; //******************delay*********************// voidDelay(intp) //**Dela
8、ypClockCycle**// { intj; for(j=0;j<=p;j++) { _nop_(); } } //*************DelayNms*********// voidDelay_ms(intn) { int i,j; for(i=0;i<=n;i++) { fo