MENU

Fun & Interesting

Learn to Write Objected Oriented C++ Code in Arduino (ESP32) -Learn to write disciplined Aduino Code

Aleksandar Haber PhD 835 7 months ago
Video Not Working? Fix It Now

#arduino #encoders #halleffect #stm32 #aleksandarhaber #robotics #engineering #robotics It takes a significant amount of time and energy to create these free video tutorials. You can support my efforts in this way: - Buy me a Coffee: https://www.buymeacoffee.com/AleksandarHaber - PayPal: https://www.paypal.me/AleksandarHaber - Patreon: https://www.patreon.com/user?u=32080176&fan_landing=true - You Can also press the Thanks YouTube Dollar button In this tutorial, we explain how to start with object oriented and C++ programming in Arduino or ESP32 microcontrollers. In particular, we explain how to write an object oriented code that will blink an external or an internal LED on your Arduino. Although this problem might look simple and you can write a simple unstructured Arduino C code to solve this problem, by doing this exercise you will learn how to write a C++ class that will govern the blinking of the LED. The techniques that you will learn in this tutorial are very important for learning how to develop a disciplined and structured code. Here is the motivation for this tutorial: I have noticed that online there a number of individuals trying to teach Arduino or microcontroller programming. Most of the time they will teach students how to develop an unstructured C code where all the code will be placed in a single Arduino source code file. This practice might work well for smaller projects. However, if you are dealing with a complex project involving a number of actuators and sensors, this programming practice is ineffective and difficult to debug. It leads to a long, cumbersome, and difficult-to-understand code file. Moreover, the code cannot be used in other projects, and all the coding time is wasted. The correct strategy is to learn to write an object oriented and modular code. This is exactly the purpose of this tutorial. The goal is to teach you how to write a disciplined and structured code. Not to obscure the main ideas with too many C++ coding details, we use the simplest possible example, and we will teach you the basic principles.

Comment