This repository contains Arduino code examples I built while following the Arduino Tutorial course by Paul McWhorter on YouTube.
Each sketch corresponds to concepts taught throughout the lessons and is kept in its own folder so it can be opened and uploaded independently.
- Instructor: Paul McWhorter
- Playlist: Arduino Tutorial (YouTube)
- Board: Arduino Uno (
arduino:avr:uno)
The board and upload port are defined per sketch in a sketch.yaml file used by
the Arduino CLI. Adjust the port
value (e.g. COM6) to match your own setup.
| Folder | Sketch | Description |
|---|---|---|
Example01 |
Example01.ino |
Reads an analog input and turns an LED on/off based on the measured voltage range. |
DimmableLed |
DimmableLed.ino |
Reads an analog input and controls LED brightness with analogWrite (PWM). |
Photoresistor |
Photoresistor.ino |
Uses a photoresistor (LDR) to switch between a green and a red LED based on ambient light. |
PushButtons |
PushButtons.ino |
Reads a push button and toggles an LED on each press. |
Buzzer |
Buzzer.ino |
Drives a buzzer, with tone/timing derived from an analog reading. |
Servo101 |
Servo101.ino |
Controls a servo motor position using the Servo library. |
- Install the Arduino IDE or the Arduino CLI.
- Open the desired example folder.
- Connect your Arduino Uno and select the correct board and port.
- Compile and upload the sketch.
cd Example01
arduino-cli compile
arduino-cli uploadThese examples are for learning purposes, based on the lessons from Paul McWhorter's course. Feel free to use them for your own study.