Practical 2
Practical 2
Objective:
Students will simulate an embedded system for a traffic light using a laptop and a virtual Arduino
board. This will help them understand how embedded systems handle real-time operations and
sequential control.
Requirements:
Laptop with internet access
Free account on Tinkercad or Wokwi
Arduino programming basics
Step-by-Step Instructions:
1. Setup the Simulation Environment (10 minutes):
Go to Tinkercad or Wokwi.
Log in and create a new Arduino project.
void setup() {
pinMode(redLed, OUTPUT); // Set red LED pin as output
pinMode(yellowLed, OUTPUT); // Set yellow LED pin as output
pinMode(greenLed, OUTPUT); // Set green LED pin as output
}
void loop() {
// Green light for 5 seconds
digitalWrite(greenLed, HIGH);
delay(5000); // 5 seconds
digitalWrite(greenLed, LOW);
Expected Outcome:
Students will understand the basics of embedded system design by simulating a traffic light
system. This exercise emphasizes real-time control and sequential logic, foundational concepts
for embedded systems.
This exercise is suitable for beginners and requires only a laptop for execution.