| Line 201... |
Line 201... |
| 201 |
|
201 |
|
| 202 |
case LIGHT_RANGE4: |
202 |
case LIGHT_RANGE4: |
| 203 |
range=64000; |
203 |
range=64000; |
| 204 |
break; |
204 |
break; |
| 205 |
} |
205 |
} |
| 206 |
return ((float)range/resolution*ret); // calculate output value |
206 |
return ((500000.0*range)/(180000.0*resolution)*ret); // calculate output value |
| 207 |
} |
207 |
} |
| 208 |
|
208 |
|
| 209 |
void loop() |
209 |
void loop() |
| 210 |
{ |
210 |
{ |
| 211 |
float luxVIS=0; |
211 |
float luxVIS=0; |
| 212 |
float luxIR=0; |
212 |
float luxIR=0; |
| 213 |
float time; |
213 |
float time; |
| 214 |
|
214 |
|
| 215 |
set_light_sensor(LIGHT_ENABLE, LIGHT_ONETIME, LIGHT_SENSE_VIS, LIGHT_INTERNAL_16, LIGHT_RANGE1); //setup sensor for visible measuring |
215 |
set_light_sensor(LIGHT_ENABLE, LIGHT_ONETIME, LIGHT_SENSE_VIS, LIGHT_INTERNAL_16, LIGHT_RANGE3); //setup sensor for visible measuring |
| 216 |
led_blink(); // Delay for measurement |
216 |
led_blink(); // Delay for measurement |
| 217 |
delay(500); |
217 |
delay(500); |
| 218 |
luxVIS=get_light_measurement(); |
218 |
luxVIS=get_light_measurement(); |
| 219 |
|
219 |
|
| 220 |
time=millis()/1000.0; |
220 |
time=millis()/1000.0; |
| 221 |
|
221 |
|
| 222 |
set_light_sensor(LIGHT_ENABLE, LIGHT_ONETIME, LIGHT_SENSE_IR, LIGHT_INTERNAL_16, LIGHT_RANGE1); // setup sensor for infrared measuring |
222 |
set_light_sensor(LIGHT_ENABLE, LIGHT_ONETIME, LIGHT_SENSE_IR, LIGHT_INTERNAL_16, LIGHT_RANGE3); // setup sensor for infrared measuring |
| 223 |
led_blink(); // Delay for measurement |
223 |
led_blink(); // Delay for measurement |
| 224 |
delay(500); |
224 |
delay(500); |
| 225 |
luxIR=get_light_measurement(); |
225 |
luxIR=get_light_measurement(); |
| 226 |
|
226 |
|
| 227 |
// open the file. note that only one file can be open at a time, |
227 |
// open the file. note that only one file can be open at a time, |