fl { POV on QuickStart PropForth 5.2 2012/11/19 11:33:56 Modified POV_1.1 a little. 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 -2 allot \ 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 d48 0 do dup i + C@ _LEDs lshift outa COG@ FF00FFFF and or outa COG! \ LED On/Off (LED16-LED23) 1 delms outa COG@ FF00FFFF and outa COG! \ All LED Off 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 d32 + then \ When even-character,d32 is added to bit_mask's address. bit_mask + L@ \ get row-data(1bit) and dup 0<> if drop 1 then ; : pov c" drive_LED" 5 cogx h7F94 char W! cnt COG@ dT L@ + begin \ main loop char W@ d128 + dup hC000 > \ If last character, return to first character if drop h8014 char W! else char W! then 2 0 do \ even/odd character i odd W! d10 0 do \ get row-data for charcter \ 8bytes per 1-charcter (last 2byte is sepaerator) i pos W! i 8 < if 0 \ set initial data 8 0 do \ get column-data i d12 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 d47 0 do dup dup i + 1+ C@ swap i + C! loop \ shift datas from buffer[i+1] to buffer[i] d47 + row_data W@ swap C! \ store new-data to last-buffer loop loop dT waitcnt fkey? swap drop until drop 5 cogreset ; decimal