Arduino For 6 Hours
Arduino For 6 Hours
**In response:**
In six hours, introduce students to Arduino programming and hardware interface through hands-
on projects that include switches, LEDs, potentiometers, and ultrasonic sensors. Students will not
only acquire practical experience but also understand the principles of electronics and coding.
**Needed Supplies:**
A board called Arduino Uno
- Circuit board
- LEDs
- Press buttons or switches.
- Potentiometers
- Sonar detecting devices
- Extension wires
- Resistors (220 ohms and 10k).
---
void loop() {
digitalWrite (13 HIGHS);
delay(1000);
digitalWrite(13), LOW;
delay(1000);
~
{~
**Activity:** Students change the code to change how quickly the lights blink and check it on
their boards.
void setup() {
pinMode(2, INPUT);
pinMode (13, OUTPUT);
~
void loop() {
buttonState and digitalRead(2) are equal.
If buttonState is set to HIGH, then
digitalWrite (13 HIGHS);
If not, ~
digitalWrite(13), LOW;
~
~
{~
**Activity:** Using the circuit connected, students modify the code to add a second LED that
can be controlled by a single switch or a separate one.
void setup() {
pinMode(9, OUTPUT);
~
void loop() {
An analogRead(A0) must equal potValue.
brightness; int map(potValue, 0, 1023, 0, 255);
analogueWrite(9, brightness);
~
{~
- **Active Assignment**: Students explore Arduino's mapping feature and experiment with
adjusting the potentiometer to adjust the brightness of the LED.
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode (13, OUTPUT);
Serial.begin(9600);
~
void loop() {
digitalWrite(trigPin, LOW);
a delay of microseconds (2);
digitalWrite(trigPin, high);
ten microseconds of delay;
digitalWrite(trigPin, LOW);
---
### Assessment
- **Project Evaluation:** Assess students based on the creativity and usefulness of their final
projects.
- **Concept Understanding:** Ask them to explain the circuit structure and coding in order to
gauge their understanding.
Students who complete this six-hour course will have a thorough understanding of Arduino as
well as useful abilities that they can use to other projects.