c51单片机编程时出现c202错误,求大神解救。(通过单片机控制输出电压)
#include<reg51.h>#include<absacc.h>#defineDAC0832XBYTE[0x7FFF]#defineVref20sbitp0=p1^...
#include<reg51.h>#include<absacc.h>#define DAC0832 XBYTE[0x7FFF]#define Vref 20sbit p0=p1^0;sbit p1=p1^1;void delay(unsigned long n){for(;n>0;n--)}void change(unsigned int a ){unsigned char i;i=(unsigned char)(a*255/Vref);DAC0832=i;}void init(){TCON=0x69;TH1=0xf3;}void key(void){if(p0==0){delay(60000);if(p0==0){ unsigned int a=a+0.1;}}if(p1==0){delay(60000);if(p1==0){ unsigned int a=a-0.1;}}}void main(void){ unsigned int a=2.5;while(1){key();change(a);delay(100);}}
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询