The example use two main libraries: seven_segment.jal for code numbers and letters, and timer0_isr_interval.jal for multitasking simulation. The movie below does not illustrate the last version of the program, so, the "ghost" effect is still obvious. Maybe I'll update the movie some day...
The scrolled text is: "HELLO JOEP AND VASILE _ THIS USE Your LibrArY"
Click on image to zoom
Digit schematic (both digit select and segment select active on 0 logic). Also, on my board(EvB 4.3), the 8 LEDs are active on 0 logic (common anode) but on your board can be common cathode if you want.
Click on image to zoom
The free terminals of the LEDs and transistors are connected to Vcc. I don't know the values of resistors from transistors base and segments (are SMD on my board) but for LEDs you can have values between 330R and 470R. As you can see, no pin has remained free on the FreeJALduino board ([Analog 5] and [AREF] pins are not connected) so, dot segments are left unconnected.
-- Scroll text on 4 seven_segment digits using-- FreeJALduino and EvB 4.3 boards.-- Copyright Vasile Guta Ciucur-- New BSD Licenseinclude freejalduino4const bit seven_segment_common_anode = trueinclude seven_segmentinclude delayconst dword timer0_isr_rate = 1000 -- 1 kHz isr rateconst DELAY_SLOTS = 2 -- one timing for scroll speed and another -- for blinking LED'sinclude timer0_isr_interval-- DECLARATIONS-- The text displayed: " HELLO JOEP AND VASILE _ THIS USE Your LibrArY "-- See "seven_segment.jal" library for corresponding codesconst byte text_string[] = { --27 is "Space" character 27,27,27,19,14,21,21,0,27, -- HELLO 28,0,14,23,27, -- JOEP 10,29,13,27, -- And 24,10,16,1,21,14,27, -- UASILE 32,27, -- _ 7,19,1,16,27, -- THIS 24,16,14,27, -- USE 4,22,26,18,27, -- Your 21,20,11,18,10,18,4,27,27,27} -- LibrArY-- the sequence for LED'sconst byte leds_sequence[] = { 0,1,3,7,15,31,63,127,255,254,252,248,240,224,192,128,0,; complete sequence 128,192,224,240,248,252,255,127,63,31,15,7,3,1}; and reverse-- the buffer for the 4 digits - the data contained here is-- permanently displayed on digits.var byte digits_buffer[4]-- indicesvar byte ix_textvar byte ix_ledprocedure PORTTEXT'put(byte in x) is var volatile bit x_0 at x:0 var volatile bit x_1 at x:1 var volatile bit x_2 at x:2 var volatile bit x_3 at x:3 var volatile bit x_4 at x:4 var volatile bit x_5 at x:5 var volatile bit x_6 at x:6 D3 = x_0 D4 = x_1 D5 = x_2 D6 = x_3 D7 = x_4 D8 = x_5 D9 = x_6end procedureprocedure show_digits is PORTTEXT = seven_from_digit(27) portA_low = 7 -- 0b0111, digits are selectable with a 0 logic on my board PORTTEXT = digits_buffer[3] delay_10us(150) -- PORTTEXT = seven_from_digit(27) portA_low = 11 -- 0b1011 PORTTEXT = digits_buffer[2] delay_10us(150) -- PORTTEXT = seven_from_digit(27) portA_low = 13 -- 0b1101 PORTTEXT = digits_buffer[1] delay_10us(150) -- PORTTEXT = seven_from_digit(27) portA_low = 14 -- 0b1110 PORTTEXT = digits_buffer[0] delay_10us(150) --end procedureprocedure update_buffer(byte in id) is digits_buffer[3] = seven_from_digit(text_string[id]) digits_buffer[2] = seven_from_digit(text_string[id + 1]) digits_buffer[1] = seven_from_digit(text_string[id + 2]) digits_buffer[0] = seven_from_digit(text_string[id + 3])end procedureprocedure PORTLED'put(byte in x) is var volatile bit x_0 at x:0 var volatile bit x_1 at x:1 var volatile bit x_2 at x:2 var volatile bit x_3 at x:3 var volatile bit x_4 at x:4 var volatile bit x_5 at x:5 var volatile bit x_6 at x:6 var volatile bit x_7 at x:7 D0 = x_0 D1 = x_1 D2 = x_2 D10 = x_3 D11 = x_4 D12 = x_5 D13 = x_6 D18 = x_7end procedure-- START = Ready, Steady, GO!-- Initializationstimer0_isr_init() -- init timer0 isrenable_digital_io()portA_direction = OutputportB_direction = OutputportC_direction = Output-- digits OFFportA_low = 0b1111-- init indexix_text = 0ix_led = 0-- fill the digits bufferupdate_buffer(ix_text)-- start LED sequencePORTLED = leds_sequence[ix_led]-- set scroll speed for textset_delay(0, 300)-- set scroll speed for LED'sset_delay(1, 100)forever loop show_digits if check_delay(0) then ix_text = ix_text + 1 if ix_text == 48 then ix_text = 0 end if update_buffer(ix_text) set_delay(0, 300) end if if check_delay(1) then ix_led = ix_led + 1 if ix_led == 31 then ix_led = 0 end if PORTLED = leds_sequence[ix_led] set_delay(1, 100) end ifend loop