As you will be able to tell from my code I am very new to this but I think what I’m trying to achieve is very simple.
When the value of the sensor is above 100, I want the RGB LED to glow red.
When the value of the sensor is below 100, I want the RGB LED to glow blue for 2 seconds and then glow green until the value is above 100 again.
This code seems to work, but once it turns green it then doesn’t react to any light changes and the serial monitor stops recording values.
PHOTOTRANSISTOR.ino (856 Bytes)