KRITSADA

microbit Run in background examples Blink

Jan 19th, 2018
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. control.inBackground(() => {
  2.     while (true) {
  3.         led.plot(0, 0)
  4.         basic.pause(100)
  5.         led.unplot(0, 0)
  6.         basic.pause(100)
  7.     }
  8. })
  9. control.inBackground(() => {
  10.     while (true) {
  11.         led.plot(1, 0)
  12.         basic.pause(300)
  13.         led.unplot(1, 0)
  14.         basic.pause(300)
  15.     }
  16. })
  17. control.inBackground(() => {
  18.     while (true) {
  19.         led.plot(2, 0)
  20.         basic.pause(200)
  21.         led.unplot(2, 0)
  22.         basic.pause(200)
  23.     }
  24. })
  25. control.inBackground(() => {
  26.     while (true) {
  27.         led.plot(0, 1)
  28.         basic.pause(500)
  29.         led.unplot(0, 1)
  30.         basic.pause(500)
  31.     }
  32. })
Advertisement
Add Comment
Please, Sign In to add comment