Beep Beep
Speak your answer to a question with a beep beep device.
Source: https://learn.adafruit.com/circuit-playground-beep-beep
Use these MakeCode blocks and JavaScript in this learn project.
Code for: Starting point
Source: https://learn.adafruit.com/circuit-playground-beep-beep/starting-point
input.buttonA.onEvent(ButtonEvent.Click, function () {
light.setAll(0xFF6600)
music.playTone(700, music.beat(BeatFraction.Half))
light.clear()
})
input.buttonB.onEvent(ButtonEvent.Click, function () {
light.setAll(0xFF6600)
music.playTone(700, music.beat(BeatFraction.Half))
light.clear()
pause(250)
light.setAll(0xFF6600)
music.playTone(700, music.beat(BeatFraction.Half))
light.clear()
})
Code for: Refactoring 4
Source: https://learn.adafruit.com/circuit-playground-beep-beep/refactor-4