|
太陽(yáng)能電池?cái)?shù)據(jù)采集系統(tǒng)仿真
基于proteus平臺(tái)
有需要的自己下載哦!有問題可以一起交流~
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
51hei.png (32.66 KB, 下載次數(shù): 81)
下載附件
2019-12-23 17:36 上傳
單片機(jī)源程序如下:
- #include <REGX51.H>
- #include <lcd1602.H>
- #include <adc0832.H>
- #include <intrins.H>
- #include <DS18B20.H>
- #define uint unsigned int
- #define uchar unsigned char
- #define Rstd 100
- sbit Switch=P3^4;
- const uchar tab[16]={'0','1','2','3','4','5','6','7','8','9','a','b','c'};
- uchar tab2[16]={"welcom To system"};
- uchar tab1[16]={" "};
- float res1,res2;
- uint R0,Ic;
- bit dog;
- void main()
- { unsigned char *pt;
- bit b;
- uint i;
- uint temp;
- lcd_init();
- display(tab2,0);
- TMOD=0x01;
- TH0=-5000/255;
- TL0=-5000%255;
- TR0=1;
- ET0=1;
- EA=1;
- while(1)
- {
- pt=ReadTemperature();
- temper_LCD(pt,tab1);
- if(++i==20){i=0;
- b=~b;
- }
- if(b){
- Switch=0; delay(1);
- res1=A_D(0)*5.0/255;
- R0=res1/(5-res1)*Rstd;
- }else{
- Switch=1;delay(1);
- res2=A_D(0)*5.0/255;
- Ic=res2*1000.0/R0;
-
- }
- temp=res2*100;
- tab1[4]='C';
- tab1[5]=tab[temp/100%10];
- tab1[6]='.';
- tab1[7]=tab[temp/10%10];
- tab1[8]=tab[temp/1%10];
- tab1[9]='V';
- temp=Ic;
- tab1[10]=tab[temp/1000];
- tab1[11]=tab[temp/100%10];
- tab1[12]=tab[temp/10%10];
- tab1[13]=tab[temp/1%10];
- tab1[14]='m';
- tab1[15]='A';
- display(tab1,0x40);
- }
- }
復(fù)制代碼
51hei.png (7.17 KB, 下載次數(shù): 82)
下載附件
2019-12-23 17:37 上傳
所有資料51hei提供下載:
太陽(yáng)能電池?cái)?shù)據(jù)采集.zip
(138.55 KB, 下載次數(shù): 151)
2019-12-23 15:56 上傳
點(diǎn)擊文件名下載附件
下載積分: 黑幣 -5
|
評(píng)分
-
查看全部評(píng)分
|