fl { POV on QuickStart PropForth 5.2 16/09/2012 19:47:00 P16 -- P23 LEDs } hex 10 wconstant _LEDs \ top of LED-array wvariable LED_data 2E allot \ buffer for LED data(5characters) clkfreq A u/ constant dT \ scroll time per dot(row) wvariable char \ character address wvariable odd \ character odd/even wvariable pos \ scan position of font wvariable row_data \ 1 row data wvariable bit_mask \ even character 10 l, 100 l, 400 l, 4000 l, 40000 l, 400000 l, 1000000 l, 10000000 l, \ odd character 20 l, 200 l, 800 l, 8000 l, 80000 l, 800000 l, 2000000 l, 20000000 l, \ ( -- ) output data inside LED_data to LED16-LED23 : drive_LED dira COG@ FF0000 or dira COG! \ set LED16-LED23 to output begin LED_data 30 0 do dup i + C@ _LEDs lshift outa COG@ FF00FFFF and or outa COG! 1 delms loop drop 0 until ; \ ( n1 n2 n3 -- n4) get row-data(1bit) from 1-column-data(32bit) \ n1:column-data n2:character type odd=0 even=1 n3:row number n4:result 0/1 : getRow 4 u* swap if 20 + then bit_mask + 4 + L@ \ get row-data(1bit) and dup 0<> if drop 1 then ; : pov c" drive_LED" 5 cogx 7F94 char W! cnt COG@ dT L@ + begin \ main loop char W@ 80 + dup C000 > if drop 8014 char W! else char W! then 2 0 do \ even/odd character i odd W! A 0 do \ get row-data for charcter i pos W! i 8 < if 0 \ set initial data 8 0 do \ get column-data i C u* char W@ + L@ swap 1 lshift swap odd W@ pos W@ getRow + loop row_data W! else 0 row_data W! then dT waitcnt \ wait 0.1sec LED_data 2F 0 do dup dup i + 1+ C@ swap i + C! loop \ shift datas from buffer[i+1] to buffer[i] 2F + row_data W@ swap C! \ store new-data to last-buffer loop loop 0 until ; decimal