If there are no errors, the compiler will complete and indicate that it is done
compiling, and you can upload your code. Click the Upload the Sketch button on
the sketch and see if you were able to simulate a stoplight.
Real-World Link
Think about the world around you. What things use blinking or flashing lights?
There are many examples such as traffic lights, holiday lights, and police lights. They
can serve as a warning or draw attention.
Careers: traffic technician, traffic light engineer, electronic engineer
STEM Connections
• Science
Ĕ Electricity
Ĕ LED lighting
• Technology
Ĕ Electronic design
Ĕ Traffic light programming
• Engineering
Ĕ Lighting types
Ĕ Optics
• Math
Ĕ Frequency
Ĕ Pattern
Tip: To solve this
extension activity, you
can find a sample sketch
in the appendix titled
GS_Activity_1_Extension_
Example.
Block-Text Correlation
Arduino Source Code
#include <PULSE.h>
PULSE pulse;
void setup() {
pulse.PulseBegin();
}
void loop() {
pulse.setRedLED(HIGH);
delay(1000);
pulse.setRedLED(LOW);
delay(1000);
}
void setup() {
pulse.PulseBegin();
void loop() {
pulse.setRedLED(HIGH);
delay(1000);
pulse.setRedLED(LOW);
delay(1000);
Note: Notice
that On
means High
and Off
means Low.
28 Getting Started Activities