
Explore an object-oriented approach with Arduino to build embedded projects, manage sensors with arrays, and implement real-time control using limited inputs, including a headlamp and a rock, paper, scissors game.
Explore the component list for the Arduino project using the USP or SB search tools, including breadboard, jumper cables, push buttons, resistors, infrared sensor, and optional motors, focusing on programming.
Explore how practical experience is the theory in programming, encouraging open mindedness and adapting methods to your own approach when implementing Arduino code, with discussion of programming languages.
Establish foundational prerequisites for this Arduino object-oriented course by ensuring basic programming knowledge, data types, and if statements, plus familiarity with wiring diagrams and C++ source code.
Explore esp32 pinout concepts for arduino, including gpio input and output, using pin 27 for sensor input or lcd output, and note variations and input-only pins like 35 and 34.
Learn to manage Arduino program states with enum, using a single state variable and a switch-case for normal, start, and finished. See inputs, blink without delay, and printing enum names.
Learn how to define and use structs in Arduino to group strings, integers, booleans, and long balances; initialize, modify fields, and print struct data.
Explore the basics of object-oriented programming with Arduino, including class structure, data encapsulation, constructors, and getters and setters, with examples on inheritance and polymorphism.
Explore overloading constructors in object oriented programming with Arduino, enabling multiple input values and polymorphism through different parameter combinations and public access to private members.
define a class in a header file with private and public members, implement its function prototypes in a cpp file, and manage includes to support object-oriented programming on Arduino.
Explore encapsulation in object-oriented programming with Arduino by using setters to modify private members, and getters to access them, with built-in validation for fields like age and last name.
Master the basics of object-oriented programming with Arduino by defining classes and encapsulating data with public and private members. Practice constructors, getters, setters, and inheritance with protected access in exercises.
Wire the ESP32 to a breadboard, then calculate and apply a series resistor to limit current for the LCD driven from 3.3 volts.
Implement a parallel pulsating LED effect on Arduino by adding a policy function, using millis timing and a fade amount to smoothly brighten and dim red, blue, and yellow LEDs.
Explore an object-oriented approach to Arduino led control with a left-to-right chasing effect. Build and debug a for-loop driven led sequence with turn-on and turn-off delays using arrays.
Explore object oriented sensor management in Arduino by using arrays to address multiple sensors at once, demonstrated with a Galton board marble lift and stepwise project development.
Learn to simulate an Arduino motor on/off by pressing a push button, display status on an LCD, and turn the motor off when a sensor is triggered.
Learn to implement infrared sensor calibration in an Arduino object-oriented program, logging sensor pins, points, and iteration counts via serial monitor and integrating calibrated results into the main sketch.
Define a button class with a header file and include guards, a public constructor that accepts a pin, and use it in main to read the button state.
Explore an object-oriented Arduino project idea to build a two-player rock-paper-scissors game, implement its game logic and algorithms, and develop a supporting website and servers.
If you use a platform version > 3.5, it can come to errors with the library of the web server as of 05/2022.
So for this example, use the following in platform.ini
platform = espressif32@3.5.0
Define first game algorithm for rock-paper-scissors on Arduino, using a main function to check win, lose, or draw, compare user input to the bot, and test with examples.
Discover how to implement an object-oriented score system in Arduino, using a game score object, indexed scores, formatted printing, random inputs, and user input within the loop.
Connect the ESP32 to wifi, configure credentials, install libraries, and run an async web server to serve index.html from SPIFFS and access it via the device IP.
Learn to implement server-sent events to push two results from the Arduino project to a website, using an event source, handling messages, and updating the webpage in real time.
Implement a led class to manage score indicators in a game, turning on and off leds to reflect win, loss, or tie states and reset them at game end.
Turn your Arduino class into a reusable library with a library.properties file, examples, and proper structure, then share it by packaging as a sip file.
Especially in the development of microcontrollers we often work with libraries, for example to control hardware components. The advantages of flexible and efficient source code design will be introduced to you in this course.
An ESP32 is used in the entire course, but all the examples (except the last one with the Website/Webserver and WIFI), exercises and explanations can be done with any Arduino.
Once you have completed this course, you will be able to…
...create your own object-oriented programs and libraries
...program reusable source code
... create clean source code architecture for flexible programming and adaptation
... code generalized classes and provide the libraries
... implement the basic concepts of OOP for your own projects and apply them immediately.
... save time for cumbersome programming. Because of the given conceptual design, your self-written code is easier to adapt.
... maintain your own code better even after a longer period of time.
What we go through in the course:
Basics of object-oriented programming in the Arduino environment. We will go through the essential contents of OOP step by step. We will get right into practical examples.
Practical example: Own LED class. Many different functions and interfaces.
Practical example 2: Galton board with marble elevator and evaluation of 12 IR sensors.
Practical example 3: Headlamp with only one(!) button, two LEDs and three light modes.
Practical example: Rock, paper, scissors game. We develop this small game. We compete against the bot and play to win two games. The logic is triggered by a web server on the ESP32 (with server side events).
My approach in the course:
None (ok, only very few) slides/Powerpoints. We start in the basics immediately with a practical example. Also the theory can be tested immediately on the Arduino with the Serial Monitor and thus immediately better understood.
The practical projects are developed together in step-by-step instructions.
Together means in this context that I demonstrate the code, depending on the task, and you can follow me along with the source code.
All codes are available for download on the platform, so you can get to the result without frustration.
No rambling explanations or theory monologues, we get right to work in the basics chapter.
Benefit from my years of experience and get the key skills in microcontroller development.
I'm looking forward to see you in class
Markus Edenhauser