Hackster is hosting Impact Spotlights: Industrial Automation. Watch the stream live on Thursday!Hackster is hosting Impact Spotlights: Industrial Automation. Stream on Thursday!
Jody
Created October 20, 2022

Project 2 Protest Piece

I used this tidentify a specific problem and or issue to protest that can be addressed through physical computing.

2 hours6
Project 2 Protest Piece

Things used in this project

Hardware components

Circuit Playground Express
Adafruit Circuit Playground Express
×1

Software apps and online services

MakeCode
Microsoft MakeCode
Cricut

Hand tools and fabrication machines

Cricut Air 2

Story

Read more

Schematics

Women's Right Alarm

For this protest project, I decided to make a comment on the reality of how easily women can be stripped of their rights in America with little to no notice and no opportunity to oppose them. I aswell as millions of young American women was woken up to this unsettling truth that we are not truly free in the land of the brave when Roe V Wade was overturned with no opportunity for the people to change that. Women all across America were shown that their bodies are not their own and neither are their rights, both are controlled by men they have never and most likely will never meet.

Code

circuitplayground-Womens-Rights-Alarm.uf2

JavaScript
To complete this project I utilized some free code from Youtuber Purple Oranji and modified it with the knowledge I gained from class. On the CPX I utilize the accelerometer to detect any motion changes in an X, Y, and Z graph and produce a sound and light sequence replicating the official S.O.S morse code sequence of three short bursts and three long bursts (..._ _ _…). I then attached a countdown sequence to allow myself time to place the CPX and completed the code by allowing me to turn off the alarm and rearm it. My code is broken into 3 sections the first being the on-start sequence that turns all pixels green letting the user know it is ready to go. The second section is the alarm parameters and tells the CPX to arm itself when button A is pressed. After a few moments, the third and final section is utilized where it tells the CPX to beep and flash in a particular sequence.
input.buttonA.onEvent(ButtonEvent.Click, function () {
    if (!(Armed)) {
        for (let index = 0; index <= 9; index++) {
            light.setPixelColor(index, 0x000000)
            pause(4000)
        }
        for (let index2 = 0; index2 <= 1; index2++) {
            light.setAll(0xff0000)
            pause(100)
            light.setAll(0xffffff)
            pause(100)
        }
        music.playTone(392, music.beat(BeatFraction.Half))
        Armed = true
        console.log(Armed)
        XSet = Math.abs(input.acceleration(Dimension.X))
        YSet = Math.abs(input.acceleration(Dimension.Y))
        ZSet = Math.abs(input.acceleration(Dimension.Z))
        console.log("X ORG" + XSet)
        console.log("Y ORG" + YSet)
        console.log("Z ORG" + ZSet)
        console.log("X" + (XSet + Buffer))
        console.log("Y" + (YSet + Buffer))
        console.log("Z" + (ZSet + Buffer))
    }
})
let Z = 0
let Y = 0
let X = 0
let ZSet = 0
let YSet = 0
let XSet = 0
let Armed = false
let Buffer = 0
light.setAll(0x00ff00)
Buffer = 30
music.setVolume(200)
Armed = false
forever(function () {
    if (Armed) {
        console.log("I'm Armed")
        X = Math.abs(input.acceleration(Dimension.X))
        Y = Math.abs(input.acceleration(Dimension.Y))
        Z = Math.abs(input.acceleration(Dimension.Z))
        console.log(X)
        console.log(Y)
        console.log(Z)
        if (X > XSet + Buffer) {
            while (!(input.buttonB.wasPressed())) {
                light.setAll(0x000000)
                light.setAll(0xff0000)
                music.playTone(262, music.beat(BeatFraction.Whole))
                music.stopAllSounds()
                light.setAll(0x000000)
                light.setAll(0xff0000)
                music.playTone(262, music.beat(BeatFraction.Whole))
                music.stopAllSounds()
                light.setAll(0x000000)
                light.setAll(0xff0000)
                music.playTone(262, music.beat(BeatFraction.Whole))
                console.log("Play tone 1")
                light.setAll(0x000000)
                light.setAll(0xff00ff)
                music.playTone(262, music.beat(BeatFraction.Double))
                music.stopAllSounds()
                light.setAll(0x000000)
                light.setAll(0xff00ff)
                music.playTone(262, music.beat(BeatFraction.Double))
                music.stopAllSounds()
                light.setAll(0x000000)
                light.setAll(0xff00ff)
                music.playTone(262, music.beat(BeatFraction.Double))
                music.stopAllSounds()
                console.log("Play tone 2")
            }
            Armed = false
            light.setAll(0x00ff00)
        }
    }
})

Credits

Jody
4 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.