ChristoferScalise

Untitled

Nov 8th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function initConnection() {
  2.     radio.sendNumber(0)
  3.     basic.showLeds(`
  4.         . . # . .
  5.         . . # . .
  6.         # # # # #
  7.         . . # . .
  8.         . . # . .
  9.         `)
  10.     radio.onReceivedNumber(function (receivedNumber: 0) {
  11.         secureState = 1
  12.     })
  13.     basic.showLeds(`
  14.         # . . . #
  15.         . # . # .
  16.         . . # . .
  17.         . # . # .
  18.         # . . . #
  19.         `)
  20. }
  21. let secureState = 0
  22. radio.setGroup(69)
  23. basic.forever(function () {
  24.     while (secureState = 0) {
  25.         initConnection()
  26.     }
  27.     while (secureState = 1) {
  28.         basic.showLeds(`
  29.             . . . . .
  30.             . . . . #
  31.             . . . # .
  32.             # . # . .
  33.             . # . . .
  34.             `)
  35.         if (input.buttonIsPressed(Button.A)) {secureState = 2}
  36.     }
  37.     while (secureState = 2) {
  38.         basic.showLeds(`
  39.             # . . . #
  40.             . # . # .
  41.             . . # . .
  42.             . # . # .
  43.             # . . . #
  44.             `)
  45.         if (pins.analogReadPin(Pin.P1)){}
  46.     }
  47. })
Advertisement
Add Comment
Please, Sign In to add comment