KRITSADA

Rotate LED

Oct 26th, 2019
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let index = 0
  2. basic.forever(function () {
  3.     index = 0
  4.     while (index <= 4) {
  5.         led.plot(index, 0)
  6.         index += 1
  7.         basic.pause(100)
  8.     }
  9.     index = 0
  10.     while (index <= 4) {
  11.         led.plot(4, index)
  12.         index += 1
  13.         basic.pause(100)
  14.     }
  15.     index = 4
  16.     while (index > 0) {
  17.         led.plot(index, 4)
  18.         index += -1
  19.         basic.pause(100)
  20.     }
  21.     index = 4
  22.     while (index > 0) {
  23.         led.plot(0, index)
  24.         index += -1
  25.         basic.pause(100)
  26.     }
  27.     index = 0
  28.     while (index <= 4) {
  29.         led.unplot(index, 0)
  30.         index += 1
  31.         basic.pause(100)
  32.     }
  33.     index = 0
  34.     while (index <= 4) {
  35.         led.unplot(4, index)
  36.         index += 1
  37.         basic.pause(100)
  38.     }
  39.     index = 4
  40.     while (index > 0) {
  41.         led.unplot(index, 4)
  42.         index += -1
  43.         basic.pause(100)
  44.     }
  45.     index = 4
  46.     while (index > 0) {
  47.         led.unplot(0, index)
  48.         index += -1
  49.         basic.pause(100)
  50.     }
  51. })
Advertisement
Add Comment
Please, Sign In to add comment