2-Basic Arduino Uno Prototyping Using WOKWI
2-Basic Arduino Uno Prototyping Using WOKWI
INTRODUCTION
In this activity, you will use the WOKWI Arduino simulator to create a project involving
three LEDs (red, yellow, blue) and a push button. The objective is to program the Arduino Uno
to cycle through three distinct LED patterns (running, blinking, and staying on) each time the
button is pressed. This hands-on project is designed to enhance your understanding of Arduino
programming, LED control, and basic circuit building in a simulated environment.
To help you get started with the concepts and tools required, I recommend watching the
following tutorial videos. These videos will guide you through setting up your WOKWI
environment and working with Arduino components:
1. Introduction to WOKWI Arduino Simulator
The Best Robotics Enterprise - Video 1: Introduction
Learn the basics of using WOKWI for Arduino simulation and how to navigate the
platform.
2. Understanding Push Buttons in Arduino
The Best Robotics Enterprise - Video 2: Push Button Tutorial
This video explains how push buttons work in Arduino projects and demonstrates how to
integrate them into your circuits.
3. LED Control and Programming
The Best Robotics Enterprise - Video 3: LED Control with Arduino
Understand how to control multiple LEDs using Arduino, and apply this knowledge to
your project.
INSTRUCTIONS
Step 1: Access WOKWI
1. Open Your Web Browser:
o Launch your preferred web browser (e.g., Chrome, Firefox, Edge).
2. Navigate to WOKWI:
o Go to the WOKWI Arduino simulator by entering the following URL in the address
bar: https://wokwi.com/
void setup() {
// Initialize LED pins as outputs
pinMode(redLED, OUTPUT);
pinMode(yellowLED, OUTPUT);
pinMode(blueLED, OUTPUT);
void loop() {
// Read the button input
int reading = digitalRead(buttonPin);
lastButtonState = reading;
void runningPattern() {
digitalWrite(redLED, HIGH);
digitalWrite(yellowLED, LOW);
digitalWrite(blueLED, LOW);
delay(500);
digitalWrite(redLED, LOW);
digitalWrite(yellowLED, HIGH);
delay(500);
digitalWrite(yellowLED, LOW);
digitalWrite(blueLED, HIGH);
delay(500);
digitalWrite(blueLED, LOW);
}
void blinkingPattern() {
digitalWrite(redLED, HIGH);
digitalWrite(yellowLED, HIGH);
digitalWrite(blueLED, HIGH);
delay(300);
digitalWrite(redLED, LOW);
digitalWrite(yellowLED, LOW);
digitalWrite(blueLED, LOW);
delay(300);
}
void stayOnPattern() {
digitalWrite(redLED, HIGH);
digitalWrite(yellowLED, HIGH);
digitalWrite(blueLED, HIGH);
// No delay, stays on
}
Feel free to explore further by customizing the LED patterns, adding more components,
or integrating additional functionalities to enhance your project. Should you encounter any
challenges or have questions, refer to WOKWI’s documentation or reach out for assistance.
Happy tinkering!