Skip to Content
Hands-On Embedded Programming with C++17
book

Hands-On Embedded Programming with C++17

by Maya Posch
January 2019
Intermediate to advanced
458 pages
10h 35m
English
Packt Publishing
Content preview from Hands-On Embedded Programming with C++17

PlantModule

At this point, we have had a detailed look at the underlying, supporting code that makes life easy when writing a new module because we don't have to do all of the housekeeping ourselves. The only thing we haven't seen yet is an actual module, or code directly pertaining to this chapter's project.

In this section, we will look at the last part of the puzzle, the PlantModule itself:

#include "base_module.h"#include <Libraries/APA102/apa102.h>#define PLANT_GPIO_PIN 5#define NUM_APA102 1class PlantModule {         static int pin;         static Timer timer;         static uint16 humidityTrigger;         static String publishTopic;         static HttpServer server;         static APA102* LED;         static void onRequest(HttpRequest& request, HttpResponse& response);public: static bool ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RTOS with Microcontrollers

Hands-On RTOS with Microcontrollers

Brian Amos

Publisher Resources

ISBN: 9781788629300Supplemental Content