Step 4:  Programming the IO

Clear previous program

Clear previous

To begin a new program, you should CLEAR the previous one.  You can do this with either the button or by typing clear.


A program that uses IO


Type the following program in the console window. (below -- assuming Olimex 2106 proto board, an LED is connected to IO(12) on the Olimex, IO(15) on many Coridium boards).

DIR(12)= 1                      ' enable pin 12 as an output
WHILE X<30
  OUT(12) = X AND 1       ' drive pin 15 high when x is odd, low when x is even
  X=X+1
  WAIT(500)
LOOP

Now RUN the program

Now RUN the program

The LED on the PCB should pulse 15 times.

You can allow the program to finish or --

Stop the program


Stop the program

To stop a running program simply press the Stop button.

On to Step 5