cc2530光敏传感器采集光照,最大值超不过127,这是怎回事?
时间:10-02
整理:3721RD
点击:
uint16 myApp_ReadLightLevel( void )
{
uint16 reading = 0;
/* Enable channel */
ADCCFG |= 0x40;
/* writing to this register starts the extra conversion */
ADCCON3 = 0x86;
/* Wait for the conversion to be done */
while (!(ADCCON1 & 0x80));
/* Disable channel after done conversion */
ADCCFG &= (0x40 ^ 0xFF);
/* Read the result */
reading = ADCH;
reading |= (int16) (ADCH << 8);
reading >>= 8;
return (reading);
}
传感器啥型号?集成的还是经过运放放大信号的?