Andrew Jankowski
Created October 14, 2020 © GPL3+

protest Object - The Riot Games

It is a board game where the players take turns throwing the brick at the board, but be careful, if you test fate, you will get hulled off.

Beginner7 hours11
protest Object - The Riot Games

Things used in this project

Hardware components

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

Software apps and online services

MakeCode
Microsoft MakeCode

Hand tools and fabrication machines

Tape, Electrical
Tape, Electrical
Tape, Velcro® Stick On Tape/Strip
Tape, Velcro® Stick On Tape/Strip

Story

Read more

Schematics

Original schematics

The original schematics are much different then the finished product/prototype. The shape is different since its very difficult to find a circular lid big enough for the play area and the housing. Also, the housing was supposed to be fully enclosed to completely protect the cpx.

Code

ProtestObject_TheRiotGames

JavaScript
Its some code I used from Makecode. The tutorials utilized were the siren code by Microsoft Makecode, as well as the accelerometer tutorial page from Adafruit. The full code is set to allow for the lights to turn on during each random interval between 5 or 10. How the lights turn on is by using the accelerometer to gauge each 2g(step) and count it as an interval towards the random amount to make the siren/lights flash. The steps are gauged by impact versus footstep, which is why the player's hand is used. When the siren goes off the lights flash during the random interval set after each reset. The trigger interval is reset every time to allow for suspense.
input.onGesture(Gesture.TwoG, function () {
    if (Math.randomRange(5, 10) == Math.randomRange(5, 10)) {
        music.siren.play()
        for (let i = 0; i < 5; i++) {
            light.showRing(
            `blue blue blue blue blue blue blue blue blue blue`
            )
            light.showRing(
            "red red red red red red red red red red"
            )
        }
        light.clear()
    }
})

Credits

Andrew Jankowski
4 projects • 0 followers

Comments