Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let tocnost = 0
- let item = 0
- input.onButtonPressed(Button.A, () => {
- radio.sendNumber(5)
- item = 5
- })
- input.onButtonPressed(Button.B, () => {
- radio.sendNumber(10)
- item = 10
- })
- radio.onDataPacketReceived(({receivedNumber}) => {
- if (receivedNumber == item) {
- basic.showLeds(`
- # # # # #
- . . # . .
- . . # . .
- . . # . .
- . . # . .
- `)
- tocnost = tocnost + 1
- } else {
- basic.showLeds(`
- # . . . #
- . # . # .
- . . # . .
- . # . # .
- # . . . #
- `)
- tocnost = tocnost - 1
- }
- })
- input.onButtonPressed(Button.AB, () => {
- basic.showNumber(tocnost)
- })
- radio.setGroup(1002)
- tocnost = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement