Details
What's inside?
Discussion
Details
Overview
This PCB traffic light module is breadboard-compatible and easy to integrate with Arduino and Axiometa platforms.
- Easy Interface
- Arduino Compatible
- Digital Input
- Genesis Matrix Compatible
Documentation
This part is fully open sourced with schematics and 3D files available bellow
AXM0024
Step by step user guide
All Axiometa products come with user guides and setting up instructions
Connection Guide
Here you’ll find connection guide images to help you integrate the sensor with various development platforms.
×
Arduino Example Code
If you haven’t already, check out this tutorial to guide you through setting up the Arduino IDE for uploading and debugging your sketches, as well as installing libraries.
For this part, you won’t need to use a library.
Code copied!
const int redPin = A2; // Red LED pin
const int yellowPin = 3; // Yellow LED pin
const int greenPin = 2; // Green LED pin
void setup() {
pinMode(redPin, OUTPUT); // Set Red LED pin as output
pinMode(yellowPin, OUTPUT); // Set Yellow LED pin as output
pinMode(greenPin, OUTPUT); // Set Green LED pin as output
}
void loop() {
// Red light on for 5 seconds
digitalWrite(redPin, HIGH);
digitalWrite(yellowPin, LOW);
digitalWrite(greenPin, LOW);
delay(2000); // Wait for 2 seconds
// Yellow light on for 2 seconds
digitalWrite(redPin, LOW);
digitalWrite(yellowPin, HIGH);
digitalWrite(greenPin, LOW);
delay(500); // Wait for 0.5 seconds
// Green light on for 5 seconds
digitalWrite(redPin, LOW);
digitalWrite(yellowPin, LOW);
digitalWrite(greenPin, HIGH);
delay(2000); // Wait for 2 seconds
// Yellow light on for 2 seconds before returning to red
digitalWrite(redPin, LOW);
digitalWrite(yellowPin, HIGH);
digitalWrite(greenPin, LOW);
delay(500); // Wait for 0.5 seconds
}
To see it working open serial monitor
MAC: CMD+Shift+M
Windows: CTRL+Shift+M
Related products
What's inside?
Discussion
Add a review
Traffic Light
Rating*
0/5
* Rating is required
Your review
* Review is required
Name
* Name is required
Email
* Email is required
0.0
Based on 0 reviews
5 star | 0% | |
4 star | 0% | |
3 star | 0% | |
2 star | 0% | |
1 star | 0% |
0 of 0 reviews
Sorry, no reviews match your current selections