Heather Parrett
Published

Heather Parrett (Project 1 - Switches and Knobs)

This project demonstrates the use of a switch in order to turn off and on the pixels on a Circuit Playground Express board from Adafruit.

BeginnerShowcase (no instructions)2 hours261
Heather Parrett (Project 1 - Switches and Knobs)

Things used in this project

Hardware components

Circuit Playground Express
Adafruit Circuit Playground Express
×1
Alligator Clips
Alligator Clips
×1
9V battery (generic)
9V battery (generic)
3.7V Lipo Battery
×1
Toggle Switch, Toggle
Toggle Switch, Toggle
×1

Software apps and online services

MakeCode
Microsoft MakeCode
Arduino IDE
Arduino IDE

Story

Read more

Code

Project Code

JavaScript
pins.A1.setPull(PinPullMode.PullUp)
forever(function () {
    if (!(pins.A1.digitalRead())) {
        light.setAll(0x00ffff)
    } else {
        light.clear()
    }
})

Credits

Heather Parrett

Heather Parrett

4 projects • 0 followers
Thanks to Adafruit.

Comments