|
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周年了!感谢大家的支持与爱护!!
一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。
|