Club

The club header declares the classes that form the core of the project, and is responsible for dealing with the inputs from the switches, controlling the relays, and updating the status of the club room:

#include <wiringPi.h> #include <wiringPiI2C.h>

The first thing of note in this header file are the includes. They add the basic WiringPi GPIO functionality to our code, as well as those for I2C usage. Further WiringPi one could include for other projects requiring such functionality would be SPI, UART (serial), software PWM, Raspberry Pi (Broadcom SoC) specific functionality, and others:

enum Log_level {    LOG_FATAL = 1,    LOG_ERROR = 2,    LOG_WARNING = 3,    LOG_INFO = 4,    LOG_DEBUG = 5 };

We define the different log levels we will be using as ...

Get Hands-On Embedded Programming with C++17 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.