Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- let item = 0
- input.onButtonPressed(Button.B, () => {
- pins.digitalWritePin(DigitalPin.P13, 1)
- item = 1
- basic.showIcon(IconNames.Yes)
- })
- input.onButtonPressed(Button.A, () => {
- music.playTone(440, music.beat(BeatFraction.Sixteenth))
- item = 0
- pins.digitalWritePin(DigitalPin.P13, 0)
- basic.showIcon(IconNames.No)
- })
- basic.forever(() => {
- if (pins.digitalReadPin(DigitalPin.P16) == 1) {
- music.playTone(pins.analogReadPin(AnalogPin.P1), music.beat(BeatFraction.Whole))
- }
- if (pins.digitalReadPin(DigitalPin.P15) == 1 && 1 == item) {
- music.playTone(pins.analogReadPin(AnalogPin.P1), music.beat(BeatFraction.Double))
- basic.showIcon(IconNames.Square)
- } else {
- basic.showLeds(`
- . . . . .
- . . . . .
- . . . . .
- . . . . .
- . . . . .
- `)
- }
- })
Add Comment
Please, Sign In to add comment