Arduino OOP

Video description

Do you want to write Arduino code that you can easily read, modify, and share with other Arduino developers? Do you already know OOP (object oriented programming), and you want to know how to apply it to Arduino?

From what I’ve seen, OOP is not frequently used with Arduino (in libraries, yes, but by most users, no). I noticed this when I got started using Arduino and created a few projects. My initial background was in software engineering, not electronics engineering, so I had a good foundation with OOP applied to desktop software or web development.

When coming to Arduino, my thought was why not use OOP on Arduino (because it’s possible!). Not many people do it, but it made my programs much more scalable and easy to read—and it worked great. Now, when I write Arduino programs, I almost always use OOP.

Seeing that there is a lack of structured resources on the internet to learn how to write OOP code for Arduino, I decided to create this course. I have packaged several years of my experience into this course so you can learn the most important stuff, starting directly with the best practices, and all that in just a few hours.

At the end of this course, you will be able to write clean Arduino code with OOP, rewrite your own projects using OOP, and create a clean and super easy-to-use OOP Arduino library.

Distributed by Manning Publications

This course was created independently by Edouard Renard and is distributed by Manning through our exclusive liveVideo platform.

About the Technology

About the Video

What's Inside
  • Master Arduino OOP (object oriented programming)
  • Write a class for any Arduino component or functionality you want
  • Package a class as an easy-to-use Arduino library
  • Make your code easier to read and scalable
  • Create clear interfaces for other developers to use
  • Use a class inside another class
  • Combine classes together to exponentially increase the possibilities of your programs without writing more code
  • Naming conventions for Arduino OOP code
  • Clearly organize your code in different files

About the Reader
  • Knowledge about basic Arduino programs with basic hardware components.
  • Understanding of the basics of Arduino time functionalities (millis, delay, etc).

About the Author

Edouard Renard is a software engineer, entrepreneur, and robotics teacher. He enjoys teaching new technologies to people and makes complex stuff easy to understand. His method is simple and contains only three words—step by step.

He knows how hard it can be to learn a new topic and to be lost in an ocean of information without knowing what to do. In his courses, he makes sure that his students learn one step at a time through practicing and that students also learn the best practices.

Edouard is passionate about robotics. He cofounded a robotics startup in 2016, building a complete robotic arm from scratch with Arduino, Raspberry Pi, Ubuntu, and ROS. He likes building cool new robotics projects in his free time. 


Table of contents

  1. Introduction
    1. Welcome to the Course!
    2. Why OOP for Arduino?
    3. List of Materials
    4. Software Setup for the Course
    5. Project Overview and How to Get the Most Out of This Course
  2. Your First Arduino Class: LED
    1. Introduction
    2. Create the Led Class Structure
    3. Add Attributes to the Led Class
    4. The Led Class Constructor
    5. Add Methods to the Led Class
    6. Use Your Class in Your Program: Create an Led Object
  3. Organize the Class in a Clear Way
    1. Introduction
    2. Create a Header File for the Class
    3. Create a .cpp file: Separate the Interface from the Implementation
    4. Recap and How to Use and Read the Interface
    5. Bonus: Make Your Class an Arduino Library
  4. Circuit for the Course
    1. Build the Circuit Step by Step
  5. Your Turn: Push Button Class
    1. Introduction
    2. Create the PushButton Class Header File (Interface)
    3. Create the PushButton Class .cpp File (Implementation)
    4. Create a PushButton Object to Read the Button’s State
    5. Handle Pull Up and Pull Down Resistors in the Class
    6. Add More Abstraction to Know When the Button Is Pressed
    7. Debounce the Button Inside the Class
    8. Combine LEDs and Buttons: Work with Multiple Objects
  6. LedBlinker: Use a Class Inside Another Class
    1. Introduction
    2. Create the LedBlinker Class and Init the Led Inside
    3. Toggle Led State from LedBlinker
    4. Make the Led Blink Without Delay (Inside the Class)
    5. Add Some Getters and Setters
    6. Application Example: Make Three LEDs Blink at Different Rates
  7. Your Turn: Traffic Light System
    1. Final Project Overview
    2. The Interface and Main Program (Help to Get Started)
    3. Set Up the TrafficLight Class
    4. Add Methods to Init and Toggle Between the Leds
    5. Add a State Machine Inside the Class
    6. Use Time Functionalities to Wait between Different States
    7. Create a Class for the Potentiometer
    8. Modify the Leds Brightness with the Potentiometer
  8. Conclusion
    1. Project Conclusion and Improvements
    2. How to Build an Arduino Project with OOP: Best Practices
    3. What to Do Next

Product information

  • Title: Arduino OOP
  • Author(s): Edouard Renard
  • Release date: August 2022
  • Publisher(s): Manning Publications
  • ISBN: 10000DIVC2022149