Question: This is the light sensor: float getLight(void) { float V_sensor = 1.5 * light_sensor.value(LIGHT_SENSOR_PHOTOSYNTHETIC)/4096; // ^ ADC-12 uses 1.5V_REF float I = V_sensor/100000; // xm1000
This is the light sensor:
float getLight(void) { float V_sensor = 1.5 * light_sensor.value(LIGHT_SENSOR_PHOTOSYNTHETIC)/4096; // ^ ADC-12 uses 1.5V_REF float I = V_sensor/100000; // xm1000 uses 100kohm resistor float light_lx = 0.625*1e6*I*1000; // convert from current to light intensity return light_lx; }
Write a C code that creates a buffer/array of 12 and puts the light values above into the array and prints when its full (when it gets to 12)
Please provide C CODE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
