Light Intensity Sensor
1. We'll start with the VEML770 light intensity sensor. You'll need:
USB cable for programming and powering your microcontroller (not shown)
Your microcontroller
One STEMMA QT / Qwiic JST SH 4-pin Cable
The (light intensity) VEML7700 sensor
2. Make sure your device is not powered
Hook your sensor as shown on the left. It doesn't matter which end of the sensor you hook to the cable, however, the cable only plugs into each of the sockets in one direction.
3. Using Mu, try this code. Remember the following:
You must name your code "code.py"
Make sure to save the code to the microcontroller, not your computer
Ensure you have the required libraries (adafruit_veml7700 and andafruit_register (which is a folder)) saved to the microcontroller's lib folder. (download all libraries here)
4. The sensor measures Lux (a unit of Illuminance). Use this chart to see if your numbers make some sense in the room and in the sun.
Challenges:
You know how to control the internal LED (or you can look back at the getting started page). Make the internal LED only light up when the lux is lower than 100.
Have a cute message print to the debug window, only when it's sunny or bright.
Create a "for loop" that measures the light intensity five or more times over at least 10 seconds, then prints the average of the readings.