-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10MorseCode.js
More file actions
42 lines (42 loc) · 1023 Bytes
/
10MorseCode.js
File metadata and controls
42 lines (42 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
radio.onReceivedNumber(function (receivedNumber) {
if (receivedNumber == 0) {
basic.showLeds(`
. . . . .
. . # . .
. # # # .
. . # . .
. . . . .
`)
} else if (receivedNumber == 1) {
basic.showLeds(`
. . . . .
. . . . .
. # # # .
. . . . .
. . . . .
`)
} else if (receivedNumber == 2) {
basic.showLeds(`
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
`)
} else {
basic.showIcon(IconNames.No)
}
basic.pause(100)
basic.clearScreen()
})
input.onButtonPressed(Button.A, function () {
radio.sendNumber(0)
})
input.onButtonPressed(Button.B, function () {
radio.sendNumber(1)
})
input.onButtonPressed(Button.AB, function () {
radio.sendNumber(2)
})
radio.setGroup(1)
basic.showString("Morse Code")