forked from RodionGork/TinyBasic
-
Notifications
You must be signed in to change notification settings - Fork 6
Led Chain Effects
Rodion Gorkovenko edited this page Sep 15, 2018
·
2 revisions
The program uses line of 8 leds to create 3 different simple dynamic effects. Effects could be changed by pressing buttons. Potentiometer affects speed.
1 pin 10;-2
2 pin 11;-2
3 pin 12;-2
10 dim e 50 b
20 data 0x55 0xAA 0
21 data 0x49 0x92 36 0
22 data 0x33 0x66 0xCC
23 data 0x99 0
25 efkt=0
30 c=0
40 gosub 100
45 c=c+1
50 if e(c)=0;c=efkt
55 delay 100+adc(3)/5
60 if pin(10)=0;efkt=0
61 if pin(11)=0;efkt=3
62 if pin(12)=0;efkt=7
70 goto 40
100 d=e(c)
105 i=2
110 pin i;d%2
115 d=d/2
120 i=i+1
125 if i<10;goto 110
130 return
Link to load and run this code in web-emulator: