Code Upload
Your chameleon is about to come alive. One upload and the lamp starts watching, adapting, and glowing — and it never stops.
Warning
Upload the Code
Click the button below to open Kriya Station with the Chameleon Lamp code pre-loaded. Follow the instructions in the Station to compile and upload to your NodeMCU.
Open in Kriya StationWhat to Expect
Unlike the Colour Picker, there's no button to press. The Chameleon Lamp runs in a continuous loop — the moment the upload finishes, the lamp springs to life:
- The LED flashes through red → green → blue quickly (that's the self-test from the setup phase).
- The lamp starts reading the surface beneath the sensor and adjusts the LED to match.
- Open the Serial Monitor to see a rolling stream of data — current RGB reading, target colour, and transition progress.
LED Not Changing?
Tip
Try It Out
Now that your lamp is alive, put it through these experiments:
The Slow Slide
Place the lamp on a red surface, then slowly slide it onto a blue one. Watch the LED fade through purple — that's lerping (linear interpolation) in action, exactly like the concept you learned.
Pattern Test
Try a patterned surface like a striped shirt or a colourful book cover. What does the lamp do? It should average the colours it sees — the trimmed mean filtering at work.
Threshold Detective
Move between two very similar shades — like light blue and slightly lighter blue. The lamp might not react. That's the colour distance threshold preventing flickering. By design, not a bug!