Rebekah Kissoon
Published

Lotus Lamp

A candle holder turned lamp using CPX.

BeginnerShowcase (no instructions)9
Lotus Lamp

Story

Read more

Code

Lotus Lamp

JavaScript
I identified pin A1 for the switch. Then, when the switch is turned on, the board displays purple and orange lights. When the switch is off, the lights turn off.
pins.A1.digitalWrite(false)
forever(function () {
    if (pins.A1.digitalRead()) {
        light.showRing(
        `purple orange purple orange purple red orange red orange red`
        )
    } else {
        light.clear()
    }
})

Credits

Rebekah Kissoon
4 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.