|
unsigned char ADCResult;
unsigned int ReadADCResult(void) //ADC结果是channel 0
{
unsigned char luxh;
unsigned char luxl;
WriteByte(0x81,0x02);//gain(1x),integration time of 402ms
WriteByte(0x86,0x00);//interrpt is level style, every ADC cycle generate one interrupt.
WriteByte(0x80,0x03);
delay();
luxl=ReadByte(0x8C);
I2C_SetACK();
luxh=ReadByte(0x8D);
I2C_SetNAK();
ADCResult=luxh*256+luxl;
//return(ADCResult);
}
luxl,luxh编译出现 a value of type "void" cannot be assigned to an entity of type "unsigned char" 怎么回事啊 |
阿莫论坛20周年了!感谢大家的支持与爱护!!
知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)
|