Last Updated 13/11/2024
Arduino/C++ Lessons Various Arduino tutorial courses
Learning to program takes time and patience. For many it means learning not only the programming side but the electronics as well. By the time I started to program the Arduino I had already learnt a number of different languages and so followed the tradition way of learning to program.
That means learning the core structures of the language and then using that core to control components. It's the way I have always learnt and if I ever have to learn another language it is the method I would always choose. The upside of this method is you can start with just the Arduino and add a starter kit later.
The downside is that you don't get to see LED's turning on and off or press buttons etc in the early lessons. That all comes once you understand the language. However, you will be able to understand code quicker and this has advantages later as you wish to add other peoples code into your own projects.
Click here for the Traditional Language Course.
Getting Started and the Arduino IDE
Preperation 1: Getting Started - What you need, Choosing a kit, downloading the Arduino IDE 17/02/2024
How to Download and Install Arduino IDE 14/07/2021
Getting Started - Arduino IDE quick tour (Version 2.3.0 or greater) 15/02/2024
A Tour of the Arduino IDE (Classic Version 1.8) 15/07/2021
Basics of C++ - Traditional Language Learning
These C++ lessons are lessons in learning C++ in the way that a traditional programmer would learn to program any computer language. The initial sections may not have any blinking LED's, but it is designed to give a good understanding of programming structure to enable the programmer to understand the code that others have written as well as understanding the various errors that occur.
Although C++ is used by Arduino IDE and desktop programming IDE's and a lot of the syntax and structure is the same. Desktop programming tends to output to the screen in a way that the Arduino IDE does not makng a lot of code examples difficult to understand for beginners.
A simple example is the" Hello World" code below, Arduino IDE on the left and desktop C++ on the right.
With all the lessons I have tried to reuse as much of the previous lessons as possible, introducing new items lesson by lesson, while reinforcing what has been learnt in earlier lessons.
Arduino 2.3 IDE Series
I decided to re record and try and improve on the original series of lessons using better cameras and production software.
Lesson (Click to watch) |
Lesson Resources |
Arduino IDE Arduino Integrated Development Envirment software. The program used to write code and upload it to the Arduino boards. CH340 Drivers Many boards use the CH340 communication chip and therefore require CH340 drivers to be installed. Other information: |
|
|
|
How to control program timings using if() and millis() Controlling multiple items with different timings. Download the code for Lesson 3
|
|
Introduction to controlling outputs with digitalWrite(). Using pinMode() Controlling multiple LED's with different timings. |
Download the code for Lesson 4 |
Introduction to controlling inputs. Introduction to digitalRead() and pull down resistors. Basic button debouncing and why it is needed. |
Download the code for Lesson 5 |
This is an extra lesson that has been added to show how to control items with toggle switches with the Arduino UNO, rather than the usually push to contact switches that come in most kits. |
Download the code for Lesson 5b |
Reading analog Pins with analogRead() map() function float variable type switch() statement |
Download the code for Lesson 6 |
Combining Sensors and Outputs. if( && ) control structure Component timers using millis() |
Download the code for Lesson 7 |
Combining Sensors and Outputs. if( || ) control structure (if(OR)) Component timers using millis() and process control using switch() and State |
Download the code for Lesson 8 |
Array basics Using the for() loop |
Download the code for Lesson 9 |
Servos |
Download the code for Lesson 10 |
Advanced Servo Control Servo position controlled by potentiometer |
Download the code for Lesson 11 |
Arduino UNO with ULN2003 and 28BYJ-48 Stepper motor tutorial using non blocking (State Machine) examples. |
Download the code for Lesson 12 |
Arduino UNO with ULN2003 and 28BYJ-48 Stepper motor tutorial Part 2 using non blocking (State Machine) examples. |
Download the code for Lesson 13 |
How to set up and use External Interrupts with the Arduino UNO. |
Download the code for Lesson 14 |
How to set up and use External Interrupts with the Arduino UNO. |
Download the code for Lesson 15 Understanding FIFO buffers |
In this lesson a single button will be used to change the mode in the Arduino sketch allowing the Arduino to change the LED pattern depending on the mode. |
Download the code for Lesson 16 |
Using the 1602A I2C LCD screen with the Arduino UNO including how to
|
Download the code for Lesson 17 |
In this lesson I will go through the steps and considerations when choosing sensors for a project, in this case a speedometer for a model railway. |
Download the code for Lesson 18 |
Arduino 1.8 IDE Series
This is the original Arduino C++ course that was created in 2021 using the Arduino Classic (version 1.8 IDE). It is being replaced by the new series.
Lesson 1: Basic sketch layout and how to comment code 15/07/2021
Lesson 2: "Hello World" Basics of printing to Serial Window 17/07/2021
Lesson 3: Using "if else" to control code 19/07/2021
Lesson 4: Using "for loop" to control code 21/07/2021
Lesson 5: Using "switch" to control code 21/07/2021
Lesson 6: Basic Numeric variables, boolean, byte, int, unsigned int, long, unsigned long 23/07/2021
Lesson 7: delay() v's millis(), controlling timing of programs 23/07/2021
Lesson 8: Basic mathematics, addition, subtraction, multiplication and division 27/07/2021
Lesson 9: Basic of creating and using functions 28/07/2021
Lesson 10: Using Global and Local variables 11/08/2021
Lesson 11: Arrays 28/08/2021
Arduino Functions
Functions 1 : digitalWrite() Using digital pins to turn things on and off 05/08/2021
Functions 2 : digitalRead() Reading a digital pin and pullup resistors 11/08/2021
Functions 3 : analoglRead() Reading an Analog pin, converting to Voltage 03/09/2021
Functions 4 : tone() and noTone(), creating sounds with a piezo speaker 24/09/2021
map() function 19/03/2024
How To's
How To 1 : Debouncing buttons 15/09/2021
How To 2 : Multiple HC-SR04 Ultrasonic sensors using bit shifting with 74HC595 05/10/2021
How To 3 : Issues when joining two sketches together 22/10/2021
How To 4 : Creating a Project - Alarm example 25/10/2021
How To 5 : Nema 17 stepper motor using micros() for timing. 08/12/2021
How To 6 : FIFO (Circular) Buffer 29/04/2024
Servo speed control with millis()
Problems and Errors
Windows 11 CVH340 driver issues 10/02/2024
Fixing a Slow IDE 10/02/2024
Arduino IDE Error messages and solutions 30/07/21
Contact
If you have a particular subject you want covered please email the address in this image: and use Arduino/C++ Lessons Various Arduino tutorial courses as a reference.
Please be aware that this is a hobby that fits around work so please be patient.