Skip to content

A full code sample with many implementations of electronic components to ease readability and modifications for future changes. Made with C++ OOP and .h-only files

Notifications You must be signed in to change notification settings

crhraphael/arduino-components

Repository files navigation

Arduino OOP Components

Commitizen friendly

A fully functional code library with many implementations of electronic components to ease readability and modifications for future changes. Made with C++ OOP with .h-only files

INDEX

REQUIREMENTS

goto index

VSCODE - https://code.visualstudio.com/

PlatformIO - https://marketplace.visualstudio.com/items?itemName=platformio.platformio-ide

DESCRIPTION

goto index

This project started as a learning process for a VSCODE extension called PlatformIO IDE.

The biggest incentive was to migrate from Arduino IDE to a more robust code editor.

DISCLAIMER

goto index

The codes found here are just pieces I wrote for my personal projects and felt like it could be useful later.

Most of it may or may not be bad examples. They work for my purposes and are all results of a good amount of time spent re-learning C++ and it's compilers.

The code uses dynamic allocations since I am applying SOLID principles to the code base. I do know that many developers are against use of OOP for embeeded microchips, but the code does not aim to be the final form of anything. And I made a non OOP example with ease just by copying and pasting the OOP ones, so everything here can be used for prototyping.

DEFINITIONS AND NAMING

As this repository grows, many new components will be added and later surely it will need some reorganizing. If you know how those components works, you can build the circuit by yourself.

example classes are the place to put your own code, it is just for organization purposes.

  • Pins are always defined inside the example classes for the simplicity of readability.
  • All examples are instantiated into the main.cpp file.

implementations combines a specific library/logic to work with a component or feature of the board.

devices translates a real eletronic component and it's behaviour to code.

helpers contains code that does not belong to a specific scenario yet, most of it should be moved to specific folders within time.

controllers are places to put together components that are part of the same micro system (logic-wise).

Since this project does not target a specific project/purpose, many examples can be built, so the main.cpp will be constantly modified to adequate the most recent examples, or the ones I use the most.

EMOJIS

goto index

Lista de emojis

INSTALLING

goto index

After downloading installing all requirements, the only step left is to build to download the project dependencies defined on the platformio.ini file.

UPLOAD

goto index

Follow PlatformIO tutorials (remember to select the correct environment variable for each programming board/microchip).

TESTS

goto index No tests yet. I know PlatformIO has a test suit, but I had no interest since this project is too generic

ENVIRONMENT VARIABLES

goto index

name desc.
uno For Arduino UNO boards.
esp12e For ESP12E boards.
nodemcu For NodeMCU boards.

COMMANDLINE

goto index

About

A full code sample with many implementations of electronic components to ease readability and modifications for future changes. Made with C++ OOP and .h-only files

Topics

Resources

Stars

Watchers

Forks