LOOPS
The first thing you should do is make your program into a loop so it is always running. In basic you make a loop by labeling the top of the the loop and using the GOTO command at the bottom of the loop
MYLABLE: 'This sets the label (note :)
HIGH 2 'Turn pin 2 on.
PAUSE 1000 'Pause for about 1 sec.
LOW 2 'Turn pin 2 of
PAUSE 1000 'Pause for about 1 sec.
GOTO MYLABLE ‘Sends it back up to top of loop
To make a loop you first have to understand labels. You can label a part of your program just by putting the label name followed by a colon. The first line in the example set the label MYLABLE. You can call your labels anything you like. Anything following the single quote mark is considered a comment, which BASIC ignores. The lines between the label and the goto are repeated. The last line sends the program back up to the label MYLABLE and starts the loop over.
| Previous slide | Next slide | Back to first slide | View graphic version |