Microsoft Small Basic

Program Listing: QLF691
GraphicsWindow.Title="Neopixel scroll 4 Arduino Uno
GraphicsWindow.Height =200
GraphicsWindow.Width =1200
GraphicsWindow.BackgroundColor ="teal
pp=LDCommPort.OpenPort ("COM12" 115200)'---------- nn=text.GetCharacter (10)

clr[1]="red
clr[3]="lime
clr[2]="yellow
clr[4]=LDColours.HSLtoRGB (210 1 .4)
clr[5]="blue
clr[6]="#080808
clr[7]="gray
clr[0]="#000000
clr[8]=LDColours.HSLtoRGB (5 1 .2)
clr[9]=LDColours.HSLtoRGB (30 1 .4)
clr[10]=LDColours.HSLtoRGB (120 1 .1)
clr[12]="magenta
clr[13]="violet
clr[11]="cyan
clr[14]="gold
clr[15]="#ffffff


tm[1]="--oo- -ooo- -ooo- --oo- ooooo --oo- ooooo -ooo- -ooo- -ooo--
tm[2]="-ooo- oo-oo oo-oo -oo-- oo-oo -oo-- oo-oo oo-oo oo-oo oo-oo-
tm[3]="--oo- ---oo ---oo -oo-- oo--- oo--- ---oo oo-oo oo-oo oo-oo-
tm[4]="--oo- --oo- -ooo- oo-o- oooo- oooo- --oo- -ooo- -oooo oo-oo-
tm[5]="--oo- -oo-- ---oo ooooo ---oo oo-oo --oo- oo-oo ---oo oo-oo-
tm[6]="--oo- oo-oo oo-oo --oo- oo-oo oo-oo -oo-- oo-oo --oo- oo-oo-
tm[7]="-oooo ooooo -ooo- -oooo -ooo- -ooo- -oo-- -ooo- -oo-- -ooo--
tm[8]="----- ----- ----- ----- ----- ----- ----- ----- ----- ------

For r=1 To 8
s1=1
For ss= 1 To 60 step 6
dm[r]=text.Append(dm[r] ldtext.Replace (text.GetSubText (tm[r] ss 6) "o" s1))
s1=s1+1
If s1>9 Then
s1=3
endif
EndFor
dm[r]=ldtext.Replace (dm[r] "-" 0)
dm[r]=ldtext.Replace (dm[r] " " 0)
EndFor

f3=1.2
ii=0

For px=1 To Text.GetLength (tm[1])
For py=1 To 8
t=text.GetSubText (dm[py] px 1)
If t=0 Then
GraphicsWindow.BrushColor=LDColours.HSLtoRGB (180 1 .2)
else
GraphicsWindow.BrushColor=clr[t]
endif
GraphicsWindow.FillEllipse (250+px*15 py*15 14 14)
EndFor
EndFor

While "true"'---------------------------------------------------------mainloop
ii=0
For py=5 To 1 Step -1
For px=1 To 8
cc=clr[text.GetSubText ( dm[px] py+Math.Remainder (oo 55) 1)]

If cc="#000000" then
GraphicsWindow.BrushColor="teal
else
GraphicsWindow.BrushColor =cc
endif
GraphicsWindow.FillRectangle (px*20 py*20 20 20)
co=ii+" "
co=text.Append (co math.Floor(math.SquareRoot (LDColours.GetRed (cc)/f3))+" ")
co=text.Append (co math.Floor(math.SquareRoot (LDColours.GetGreen (cc)/f3))+" ")
co=text.Append (co math.Floor(math.SquareRoot (LDColours.GetBlue (cc)/f3)))
ii=ii+1

rr=LDCommPort.TXString (co+nn)
Program.Delay (3)'-----------------------adjust arduino cmd delay
EndFor
EndFor
oo=oo+1
Program.Delay (12)'---------------scroll delay
endwhile