Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
austin menard
Published

Annoying Pluto

Pluto that makes an annoying sound when tipped over (SOUND WARNING VERY LOUD)

BeginnerFull instructions provided173
Annoying Pluto

Things used in this project

Hardware components

Circuit Playground Express
Adafruit Circuit Playground Express
×1
Battery, 3.7 V
Battery, 3.7 V
×1

Story

Read more

Schematics

Simple Tilt Code

Modified SimpleTilt code from MakeCode

Code

Simple Tilt Code

C#
Makes a sound when the CPX tilts.
input.onGesture(Gesture.TiltLeft, function () {
    light.showRing(
    `yellow yellow yellow yellow yellow black black black black black`
    )
    for (let i = 0; i < 3; i++) {
        music.playTone(Note2, music.beat(BeatFraction.Half))
        Note2 += 30
        light.clear()
    }
})
input.onGesture(Gesture.TiltDown, function () {
    light.showRing(
    `black black black purple purple purple purple black black black`
    )
    for (let i = 0; i < 3; i++) {
        music.playTone(Note2, music.beat(BeatFraction.Half))
        Note2 += -30
        light.clear()
    }
})
input.onGesture(Gesture.TiltUp, function () {
    light.showRing(
    `white white black black black black black black white white`
    )
    for (let i = 0; i < 3; i++) {
        music.playTone(Note2, music.beat(BeatFraction.Half))
        Note2 += 30
        light.clear()
    }
})
input.onGesture(Gesture.TiltRight, function () {
    light.showRing(
    `black black black black black blue blue blue blue blue`
    )
    for (let i = 0; i < 3; i++) {
        music.playTone(Note2, music.beat(BeatFraction.Half))
        Note2 += -30
        light.clear()
    }
})
let Note2 = 0
Note2 = 175
music.setVolume(255)
music.setTempo(120)

Credits

austin menard
4 projects • 0 followers

Comments