Spodnji video osnovni test:
Za test smo uporabili:
1 kos. MicroMaestro krmilnik
4 kos. ShiftBrite modul
Slika
Program
#priklop modulov
#rjava je povezana na maso pri 0 (E)
#oranzna je servo izhod 0 (C)
#vijolicna je servo izhod 1 (L)
#bela je servo izhod 2 (D)
#rdeca na pwr pri 0 (V+)
#crna na maso pri 1 (Gnd)
#napajanje 7,5 V
#maestro se napaja iz usb (ali preko prevezave)
#vse nastavljeno kot Output
begin
cylon
b b b b rgbd
r b b b rgbd
b r b b rgbd
b b r b rgbd
b b b r rgbd
b b b b rgbd
b b b r rgbd
b b r b rgbd
b r b b rgbd
r b b b rgbd
b b b b rgbd
r b b b rgbd
2r b b rgbd
b 2r b rgbd
b b 2r rgbd
b b b r rgbd
b b b b rgbd
b b b r rgbd
b b 2r rgbd
b 2r b rgbd
2r b b rgbd
r b b b rgbd
b b b b rgbd
r b b b rgbd
2r b b rgbd
3r b rgbd
b 3r rgbd
b b 2r rgbd
b b b r rgbd
b b b b rgbd
b b b r rgbd
b b 2r rgbd
b 3r rgbd
3r b rgbd
2r b b rgbd
r b b b rgbd
b b b b rgbd
r b b b rgbd
2r b b rgbd
3r b rgbd
r r r r rgbd
b 3r rgbd
b b 2r rgbd
b b b r rgbd
b b b b rgbd
b b b r rgbd
b b 2r rgbd
b 3r rgbd
r r r r rgbd
3r b rgbd
2r b b rgbd
r b b b rgbd
b b b b rgbd
prehodbg #tukaj je prehod iz blue na green
#sedaj pa se zelena osnovna
g g g g rgbd
r g g g rgbd
g r g g rgbd
g g r g rgbd
g g g r rgbd
g g g g rgbd
g g g r rgbd
g g r g rgbd
g r g g rgbd
r g g g rgbd
g g g g rgbd
r g g g rgbd
2r g g rgbd
g 2r g rgbd
g g 2r rgbd
g g g r rgbd
g g g g rgbd
g g g r rgbd
g g 2r rgbd
g 2r g rgbd
2r g g rgbd
r g g g rgbd
g g g g rgbd
r g g g rgbd
2r g g rgbd
3r g rgbd
g 3r rgbd
g g 2r rgbd
g g g r rgbd
g g g g rgbd
g g g r rgbd
g g 2r rgbd
g 3r rgbd
3r g rgbd
2r g g rgbd
r g g g rgbd
g g g g rgbd
r g g g rgbd
2r g g rgbd
3r g rgbd
r r r r rgbd
g 3r rgbd
g g 2r rgbd
g g g r rgbd
g g g g rgbd
g g g r rgbd
g g 2r rgbd
g 3r rgbd
r r r r rgbd
3r g rgbd
2r g g rgbd
r g g g rgbd
g g g g rgbd
prehodgb
repeat
#sub prvadol
#1020
#begin
#dup
#while
#dup 20 minus 0 0 blue blue blue rgb
#dup 40 equals if 40 else 20 endif minus
#repeat
#drop return
#sub prvagor
#1020
#begin
#dup
#while
#dup 1020 minus negate 0 0 blue blue blue rgb
#dup 40 equals if 40 else 20 endif minus
#repeat
#drop return
sub prehodbg
0 255 767 0 255 767 0 255 767 0 255 767 rgbd
0 511 511 0 511 511 0 511 511 0 511 511 rgbd
0 767 255 0 767 255 0 767 255 0 767 255 rgbd
return
sub prehodgb
0 767 255 0 767 255 0 767 255 0 767 255 rgbd
0 511 511 0 511 511 0 511 511 0 511 511 rgbd
0 255 767 0 255 767 0 255 767 0 255 767 rgbd
return
sub 2r
r r
return
sub 3r
r r r
return
sub 4r
r r r r
return
sub b
blue
return
sub r
red
return
sub g
green
return
sub cylon
blue prazno prazno prazno rgbd
prazno blue prazno prazno rgbd
prazno prazno blue prazno rgbd
prazno prazno prazno blue rgbd
prazno prazno blue prazno rgbd
prazno blue prazno prazno rgbd
red prazno prazno prazno rgbd
prazno red prazno prazno rgbd
prazno prazno red prazno rgbd
prazno prazno prazno red rgbd
prazno prazno red prazno rgbd
prazno red prazno prazno rgbd
red prazno prazno prazno rgbd
prazno prazno prazno prazno rgbd
red red prazno prazno rgbd
prazno red red prazno rgbd
prazno prazno red red rgbd
prazno red red prazno rgbd
red red prazno prazno rgbd
prazno prazno prazno prazno rgbd
return
sub rgbd
rgb d
return
sub bl3
2 begin
dup while
#tukaj karkoli ze
1 minus repeat
drop return
sub prazno
0 0 0
return
sub blue
0 0 1023
return
sub red
1023 0 0
return
sub green
0 1023 0
return
sub yellow
0 1023 1023
return
sub white
1023 1023 1023
return
sub orange
0 1023 512
return
# Subroutine for setting the RGB value of a ShiftBrite/ShiftBar.
# example usage: 1023 511 255 rgb
sub rgb
na_eno_led
na_eno_led
na_eno_led
na_eno_led
0 1 8000 1 servo servo # toggle the latch pin
return
#tukaj posljemo na eni ledici komando
sub na_eno_led
0 send_bit # this bit does not matter
0 send_bit # the "address" bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
return
# sends a numerical value as a sequence of 10 bits
sub send_10_bit_value
512
begin
dup
while
over over bitwise_and send_bit
1 shift_right
repeat
drop drop
return
# sends a single bit
sub send_bit
if 8000 else 0 endif
2 servo # set DATA to 0 or 1
0 0 8000 0 servo servo # toggle CLOCK
return
sub d
100 delay
return
sub moving_wait
begin
get_moving_state
while
# wait until it is no longer moving
repeat
#500 delay
return