How it Works
The description line “*** Main program loop ***”
begins this section and it is quickly followed by the
‘ Main program loop
This label defines a location within the program where
the main section of code begins. Under this label is where
the LED is functioned. The HIGH and LOW command do
most of the work. The HIGH command is used to output
five volts to the LED. The LOW command is used to output
ground or zero volts to the LED. Both commands are
followed by the port number connected to the LED.
This makes the HIGH and LOW commands act on the P1
‘Set LED0 on
‘Set LED0 off
Because the HIGH and LOW commands are so quick,
a delay between these commands is required to make the
LED blink visible. The amount of time the LED is off or on
is controlled by the PAUSE command.
The PAUSE command does nothing but delay. The
PAUSE command includes a number that determines how
many milliseconds (1/1000’s of a second) to delay. In this
case, 1,000 is used which represents 1,000 milliseconds
or one second.
pause 1000 ‘ Delay for 1 second
Finally, the program goes into a loop so the whole
process can be completed over and over again. Using the
GOTO command generates the loop. The GOTO command
is used to jump program control back to the top of the loop
or to the “main” label.
‘ Loop back and do it again
To make sure the program does not get lost, the END
command is added at the bottom. If this command is ever
encountered, the program will stop running until the reset
switch is pressed or power is removed and reconnected.
The Ultimate OEM Atom Nano module is a great
development tool for the beginner. Figure 8 shows it
connected to a breadboard so you can easily connect
more circuitry to the header pins. There are many options
for getting started with microcontrollers but the Atom
Nano is one of the best for the true beginner. We’ll use
this module in future projects to help you get your feet
Figure 7. Ultimate OEM
Figure 8. Ultimate OEM
Atom Module connected
to a breadboard.
me an email at
gmail.com if you have
a suggestion for a