Smart Led Example

This program will use the sled command in two ways.
For this program you need a strip of 4 smart LEDs connected to port pin C5 of the JackBord.
This program will set 4 LEDs to colors 1, 2, 3 and 4 respectively and do it live, so the LEDs will update as the program runs. Note there is a 1 second delay between each LED being set.

In the second test the LEDs are set to the same colors with the same 1 second delay, except that we added the 0 at the end of each sled command.
This tells the JackBord NOT to update the LEDs in real time and instead they all get turned on in one go at the end when the uled command is run.

This shows the effect of the uled command.
The program will run a few times and stop.

Program


---

Smart Led Example Program No 1

---


prog_vars =

d/count 0

prog_vars.


prog_start =

pclear

print "Setup Program"

-- Setup 4 smart LEDs

sledn 4

prog_start.


prog_loop =


-- Update the LEDs as we go.

"Test 1 Update live"

sledoff


sled 1 1

d500

sled 2 2

d500

sled 3 3

d500

sled 4 4

d500

sledoff

-- Update the LEDs at the end.

"Test 2 Update at end."

sled 1 1 0

d500

sled 2 2 0

d500

sled 3 3 0

d500

sled 4 4 0

d500

-- Update ALL LEDs in one go.

usled

dly 1000

sledoff

inc /count

any /count >= 3 -> exitprog


prog_loop.

prog_stop =

print "Bye"

sledoff

prog_stop.