KRITSADA

Running LED on 5x5 microbit

Sep 20th, 2018
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let index = 0
  2. index = 0
  3. basic.forever(() => {
  4.     for (let index2 = 0; index2 <= 4; index2++) {
  5.         led.plot(index2, 0)
  6.         basic.pause(100)
  7.     }
  8.     for (let index3 = 0; index3 <= 4; index3++) {
  9.         led.unplot(index3, 0)
  10.         basic.pause(100)
  11.     }
  12.     for (let index4 = 0; index4 <= 4; index4++) {
  13.         led.plot(4, index4)
  14.         basic.pause(100)
  15.     }
  16.     for (let index5 = 0; index5 <= 4; index5++) {
  17.         led.unplot(4, index5)
  18.         basic.pause(100)
  19.     }
  20.     for (let index6 = 4; index6 >= 0; index6--) {
  21.         led.plot(index6,4 )
  22.         basic.pause(100)
  23.     }
  24. for (let index62 = 4; index62 >= 0; index62--) {
  25.         led.unplot(index62,4 )
  26.         basic.pause(100)
  27.     }
  28. for (let index63 = 4; index63 >= 0; index63--) {
  29.         led.plot(0, index63)
  30.         basic.pause(100)
  31.     }
  32. for (let index622 = 4; index622 >= 0; index622--) {
  33.         led.unplot(0,index622)
  34.         basic.pause(100)
  35.     }
  36. })
Advertisement
Add Comment
Please, Sign In to add comment