Flashing LEDs
Step 3: Assembling the Project
Programming
With all the parts connectted, its time to program the PICAXE 18X.
RUn the software that accompanies the PICAXE, PICAXE Programming Editor. In the settings option set the PICAXE to 18X and choose the right COM port.
Below is the code for the flashing LEDs;
main:           'Label, defines the name of a precedure
high 7           'Turns Output 7 high
low 6           'Turns output 6 low
pause 500        'Creates a for pause for 0.5 seconds (1 = 1mS)
low 7           'Turns output 7 low
high 6           'Turns Output 6 high
pause 500        'Creates a for pause for 0.5 seconds (1 = 1mS)
goto main        'Returns to the start of the program
The above code will simply make the LEDs flash alternatingly every 0.5 seconds
|