Purpose: Using the embedded controller to produce a programmed output (LED indication).
Objective: This workshop is designed to familiarize the student with elements of the embedded microcontroller.
Real world application: Controlling a traffic light.
Requirements:
1. Hardware:
2. PBasic Software Commands:
Procedure: Set the LEDs vertically on the photoboard:
Red on top
Yellow below red
Green below yellow
Step 1 - Light the red LED for 9 seconds.
Step 2 - Turn off red LED, then light the green LED for 7 seconds.
Step 3 - Turn off the green led, then light the yellow LED for 3 seconds
Repeat steps 1 through 3 forever.
Circuit Drawing for Workshop #1
PicBasic Code for Workshop #1
set:
high 1 'red LED
pause 9000
low 1
high 3 'green LED
pause 7000
low 3
high 2 'yellow LED
pause 3000
low 2
goto set