36 #include "dev/light.h"
43 sensors_light_init(
void)
50 ADC12CTL0 = REF2_5V + SHT0_6 + SHT1_6 + MSC;
51 ADC12CTL1 = SHP + CONSEQ_3 + CSTARTADD_0;
53 ADC12MCTL0 = (INCH_4 + SREF_0);
54 ADC12MCTL1 = (INCH_5 + SREF_0);
56 ADC12CTL0 |= ADC12ON + REFON;
108 sensors_light1_lux(
void)
111 temp = (uint32_t)ADC12MEM0;
113 temp = (temp*3125)>> 9;
114 return (uint16_t)(temp & 0xFFFF);
119 sensors_light2_lux(
void)
122 temp = (uint32_t)ADC12MEM1;
124 temp = (temp*625)>> 10;
125 return (uint16_t)(temp & 0xFFFF);