ChristoferScalise

microbit security

Nov 14th, 2019
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. let secureState = 0
  2. basic.forever(function () {
  3. while (secureState == 0) {
  4. if (input.buttonIsPressed(Button.A)) {
  5. secureState = 1
  6. }
  7. }
  8. while (secureState == 1) {
  9. if (input.buttonIsPressed(Button.B)) {``
  10. secureState = 0
  11. }
  12. if (pins.analogReadPin(AnalogPin.P1) > 900) {
  13. basic.showLeds(`
  14. # . . . #
  15. . # . # .
  16. . . # . .
  17. . # . # .
  18. # . . . #
  19. `)
  20. basic.forever(function () {
  21. music.ringTone(Note.C)
  22. })
  23. } else { }
  24. }
  25. })
Advertisement
Add Comment
Please, Sign In to add comment