# Main Command: Go [XLogo] # LED Display by Guy Walker # www.logoarts.co.uk to new # set default screen, pen and turtle ResetAll SetScreenSize [400 400] HideTurtle SetSC Black SetPC Green SetPS 1 PenUp end to init # Global list, Display Make "Display [] Make "Line [] Repeat 11 [Make "Line LPut 0 :Line] Repeat 12 [Make "Display LPut :Line :Display] end to footer :x # write value of :X as footer SetPos [-190 -186] SetPW 11 SetH 90 SetPC DarkBlue PenDown Forward 378 PenUp SetPos [-190 -190] SetPC White SetPW 1 SetH 0 Label :X end to draw :display # draw grid of LED's in correct color For [N 1 12] [ For [M 1 11] [ Make "Col Item :M Item :N :Display SetPC ( List :Col 36 36 ) SetPenWidth 24 Dot List :N*32-210 :M*33-187] ] end to scan :n # create list from vertical single pixel line in footer Make "Line [] For [M 1 11] [ Make "Col FindColor List :N :M-192 Make "Line LPut (Item 1 :Col) :Line ] # draw a green text underscore in footer SetPC Green SetPW 1 Dot List :N Minus 192 Output :Line end to messagelength :x # calculate length of message list :X Make "Length 0 For (List "N 1 Count :X) [ Make "Length :Length + LabelLength Item :N :X] Output 9 + :Length + 4*Count :X end to go :x New Animation Init Footer :X Make "Length MessageLength :X # stop when whole label length drawn For (List "N 0 :Length) [ # update display list by removing first and adding last item Make "Display ButFirst LPut Scan :N-190 :Display Draw :Display Refresh Wait 12] # Wait time adjusts scroll speed end