Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input.onGesture(Gesture.LogoUp, () => {
- radio.sendNumber(7)
- basic.showLeds(`
- # # # # #
- # # # # #
- . . . . .
- . . . . .
- . . . . .
- `)
- })
- input.onButtonPressed(Button.A, () => {
- radio.sendNumber(1)
- basic.showLeds(`
- . . . . .
- # # . . .
- # # . . .
- . . . . .
- . . . . .
- `)
- })
- input.onButtonPressed(Button.AB, () => {
- radio.sendNumber(3)
- basic.showLeds(`
- . . . . .
- # # . # #
- # # . # #
- . . . . .
- . . . . .
- `)
- })
- radio.onDataPacketReceived( ({ receivedNumber }) => {
- if (receivedNumber == 3) {
- iBIT.Motor(ibitMotor.Forward, 60)
- } else if (receivedNumber == 1) {
- iBIT.Spin(ibitSpin.Left, 50)
- basic.pause(150)
- iBIT.MotorStop()
- } else if (receivedNumber == 7) {
- iBIT.Motor(ibitMotor.Backward, 50)
- } else if (receivedNumber == 2) {
- iBIT.Spin(ibitSpin.Right, 50)
- basic.pause(150)
- iBIT.MotorStop()
- } else if (receivedNumber == 8) {
- iBIT.Motor(ibitMotor.Forward, 100)
- } else if (receivedNumber == 5) {
- iBIT.Spin(ibitSpin.Left, 70)
- basic.pause(150)
- iBIT.MotorStop()
- } else if (receivedNumber == 6) {
- iBIT.Spin(ibitSpin.Right, 70)
- basic.pause(150)
- iBIT.MotorStop()
- } else {
- iBIT.MotorStop()
- }
- })
- input.onGesture(Gesture.ScreenUp, () => {
- radio.sendNumber(9)
- basic.showLeds(`
- . . . . .
- . # # # .
- . # # # .
- . # # # .
- . . . . .
- `)
- })
- input.onGesture(Gesture.TiltLeft, () => {
- radio.sendNumber(5)
- basic.showLeds(`
- # # . . .
- # # . . .
- # # . . .
- # # . . .
- # # . . .
- `)
- })
- input.onGesture(Gesture.TiltRight, () => {
- radio.sendNumber(6)
- basic.showLeds(`
- . . . # #
- . . . # #
- . . . # #
- . . . # #
- . . . # #
- `)
- })
- input.onGesture(Gesture.LogoDown, () => {
- radio.sendNumber(8)
- basic.showLeds(`
- . . . . .
- . . . . .
- . . . . .
- # # # # #
- # # # # #
- `)
- })
- input.onGesture(Gesture.Shake, () => {
- radio.sendNumber(4)
- basic.showLeds(`
- . . . . .
- . . . . .
- . . . . .
- . . . . .
- . . . . .
- `)
- })
- input.onButtonPressed(Button.B, () => {
- radio.sendNumber(2)
- basic.showLeds(`
- . . . . .
- . . . # #
- . . . # #
- . . . . .
- . . . . .
- `)
- })
- radio.setGroup(50)
- basic.showIcon(IconNames.Yes)
Advertisement
Add Comment
Please, Sign In to add comment