Connor Wardell
Published © GPL3+

Protest Object for Young Introverts

For this project I made a small framed board that when tilted towards an emotion, lights up the corresponding light.

BeginnerShowcase (no instructions)1 hour176
Protest Object for Young Introverts

Things used in this project

Hardware components

Circuit Playground Express
Adafruit Circuit Playground Express
×1
Li-Ion Battery 1000mAh
Li-Ion Battery 1000mAh
×1

Story

Read more

Code

JavaScript

JavaScript
A simple code to light up the board when tilted up, down, left and right.
light.setBrightness(10)
forever(function () {
    if (input.acceleration(Dimension.Y) >= 350) {
        light.showRing(
        `purple purple purple purple purple purple purple purple purple purple`
        )
    } else if (input.acceleration(Dimension.Y) <= -350) {
        light.showRing(
        `green green green green green green green green green green`
        )
    } else if (input.acceleration(Dimension.X) >= 350) {
        light.showRing(
        `blue blue blue blue blue blue blue blue blue blue`
        )
    } else if (input.acceleration(Dimension.X) <= -350) {
        light.showRing(
        `red red red red red red red red red red`
        )
    } else {
        light.clear()
    }
})

Credits

Connor Wardell
4 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.