Declan Ford
Published © GPL3+

Public Discourse Protest Object

I created a box that lights up green when people are speaking at a acceptable level. It flashes red and plays siren when people yell at it.

BeginnerShowcase (no instructions)2 hours411
Public Discourse Protest Object

Things used in this project

Hardware components

Circuit Playground Express
Adafruit Circuit Playground Express
×1
Toggle Switch, Toggle
Toggle Switch, Toggle
×1
Alligator Clips
Alligator Clips
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1

Software apps and online services

MakeCode
Microsoft MakeCode

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)
Tape, Clear
Tape, Clear
Scissors, Free Fall
Scissors, Free Fall

Story

Read more

Code

Be Civil Box

JavaScript
let Sound = 0
pins.A1.setPull(PinPullMode.PullUp)
forever(function () {
    Sound = input.soundLevel()
    light.setBrightness(255)
    music.setVolume(255)
    if (pins.A1.digitalRead()) {
        if (Sound > 150) {
            light.setAll(0xff0000)
            music.siren.playUntilDone()
            pause(100)
            light.clear()
        }
        if (Sound <= 150) {
            light.setAll(0x00ff00)
            pause(100)
            light.clear()
        }
    }
})

Credits

Declan Ford

Declan Ford

4 projects • 0 followers

Comments