Automatic Dark Mode
This week I wanted to adjust the display brightness from the readings on VEML6035 ambient light sensor. Unlike other sensors, VEML6035 did not have a built-in library on Arduino IDE. I had to spend hours watching how to use Wire library, which allows I2C communication easily. Then, I looked at the datasheet to set the initial setting and calculate lux (unit for illuminance). My initial plan was to adjust the back panel to control the brightness, but on this particular TFT display, there wasn’t a dedicated backlight pin. It meant the backlight would be fully on 24/7, so I adjusted my plan to switch between dark and light mode. The condition to trigger the mode change is that the ambient light sensor would measure every 0.5s and if the average of the last ten lux values is below 10, then the smartwatch changes to dark mode and vice versa.