Light in circles
The following example will "circulate" the light along 8 LEDs in one direction.
- Schematic: FreeJALduino and FreeJALduino5
- Firmware: the same as above
Common anode configuration, that means LED is active on 0 logic. Resistors value is 330R.
-- hardware setup include freejalduino4 include delay enable_digital_io() D0_direction = output D1_direction = output D2_direction = output D3_direction = output D4_direction = output D5_direction = output D6_direction = output D7_direction = output -- end hardware setup -- global initialization D0 = high D1 = high D2 = high D3 = high D4 = high D5 = high D6 = high D7 = low -- end initialization delay_1ms(250) forever loop D0 = low D7 = high delay_1ms(250) D1 = low D0 = high delay_1ms(250) D2 = low D1 = high delay_1ms(250) D3 = low D2 = high delay_1ms(250) D4 = low D3 = high delay_1ms(250) D5 = low D4 = high delay_1ms(250) D6 = low D5 = high delay_1ms(250) D7 = low D6 = high delay_1ms(250) end loop