Micro:bit krúžok
Z SensorWiki
Verzia z 13:40, 7. marec 2018, ktorú vytvoril StudentDVPS (diskusia | príspevky)
Verzia z 13:40, 7. marec 2018, ktorú vytvoril StudentDVPS (diskusia | príspevky)
7. marca 2018
- Robili sme toto..
Ovládač na Moto:bit
radio.setGroup(1)
basic.forever(() => {
if (input.buttonIsPressed(Button.AB)) {
radio.sendString("FORWARD")
basic.showLeds(`
. . # . .
. # # # .
# . # . #
. . # . .
. . # . .
`)
} else if (input.buttonIsPressed(Button.B)) {
radio.sendString("LEFT")
basic.showLeds(`
. . # . .
. # . . .
# # # # #
. # . . .
. . # . .
`)
} else if (input.buttonIsPressed(Button.A)) {
radio.sendString("RIGHT")
basic.showLeds(`
. . # . .
. . . # .
. # # # #
. . . # .
. . # . .
`)
} else {
radio.sendString("OFF")
basic.showLeds(`
. # # # .
# # . # #
# . # . #
# # . # #
. # # # .
`)
}
})