Understanding Object-Oriented Programming and Creating Arduino Libraries
Object-Oriented Programming (OOP) is one of the excellent features of the C++ language. It is widely used throughout the Arduino ecosystem, particularly when it comes to reusable Arduino libraries. However, it is also an advanced feature that can be a little confusing at first. This chapter will introduce you to the concept behind OOP, guide you through writing your first object-oriented program, and show you how to create an Arduino library from scratch, which you can then use in your own projects or even share with the wider Arduino community.
This chapter is structured into the following main sections:
- Understanding the OOP paradigm
- Writing your first class
- Turning your class into an Arduino library
- Working with third-party Arduino libraries