完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
刚刚做了一个ADC0804LCN进行数模转换,接线导入程序后调节电位器发现ADC0804LCN的8个输出口一直是0,不知道什么原因。 程序:#include #define uchar unsigned char #define uint unsigned int uchar code table1[]="0123456789"; uchar code table2[]="DianYa:0.00V"; uchar code table3[]="made by GYS "; uchar num,adval,date; ***it lcden=P2^2; ***it lcdrs=P2^0; ***it lcdrw=P2^1; ***it lcds1=P3^3; ***it lcds2=P3^4 ; ***it adwr=P3^6; ***it adrd=P3^7; ***it adcs=P3^5; void delay(uint z) { uint x,y; for(x=z;x>0;x--) for(y=110;y>0;y--); } void delay_50us(uint t) { uchar j; for(;t>0;t--) for(j=19;j>0;j--); } //LCD写指令 void write_com(uchar com) { lcdrs=0; P0=com; delay(5); lcden=1; delay(5); lcden=0; } //LCD写数据 void write_date(uchar date) { lcdrs=1; P0=date; delay(5); lcden=1; delay(5); lcden=0; } //初始化函数 void init() { adcs=0; lcdrw=0; lcden=0; write_com(0x38); write_com(0x0c); write_com(0x06); write_com(0x01); write_com(0x80); while(table3[num]!=' |