Return to basic ladder board sequencer

This is another take on the Cylon program that comes with the raspberry pi

100 // ladder set up
110 FOR i = 0 TO 9 CYCLE
120 PinMode (i, 1) // Output
130 DigitalWrite (i, 0) // Off
140 REPEAT
150 FOR i = 10 TO 13 CYCLE
160 PinMode (i, 0) // Input
170 PullUpDn (i, 2) // Activate internal pull-up
180 REPEAT
190 // Make some globals
200 //
210 ledRed1 = 0
220 ledRed2 = 1
230 ledYellow1 = 2
240 ledYellow2 = 3
250 ledGreen1 = 4
260 ledGreen2 = 5
270 ledBlue1 = 6
280 ledBlue2 = 7
290 gMan = 8
300 rMan = 9
310 //
320 buttonA = 11
330 buttonB = 10
340 buttonC = 12
350 buttonD = 13
360 // program start
370 CYCLE
375 DELAY = 0.15
380 DigitalWrite (ledGreen1, 1)
390 DigitalWrite (ledYellow2, 1)
400 WAIT (DELAY)
410 DigitalWrite (ledGreen2, 1)
420 DigitalWrite (ledYellow1, 1)
430 WAIT (DELAY)
440 DigitalWrite (ledGreen1, 0)
450 DigitalWrite (ledYellow2, 0)
460 WAIT (DELAY)
470 DigitalWrite (ledRed2, 1)
480 DigitalWrite (ledBlue1, 1)
490 WAIT (DELAY)
500 DigitalWrite (ledGreen2, 0)
510 DigitalWrite (ledYellow1, 0)
520 WAIT (DELAY)
530 DigitalWrite (ledRed1, 1)
540 DigitalWrite (ledBlue2, 1)
550 WAIT (DELAY)
560 DigitalWrite (ledRed2, 0)
570 DigitalWrite (ledBlue1, 0)
580 WAIT (DELAY)
590 DigitalWrite (ledRed1, 0)
600 DigitalWrite (ledBlue2, 0)
610 WAIT (DELAY)
620 REPEAT
630 END

 

Change line 375 to make it run faster or slower

 

Screenshot from 2013-03-23 16:54:00

 

As Return to basic files are plain text you can use any text editor to edit the files, here I have done this to make it quicker to change the lines with wait in them from WAIT (0.5) TO WAIT (DELAY) where DELAY is set in Line 375.

The grey is due to the program being highlighted.