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

PWM

The reason why the PWM module was developed was to have a way to generate an analog output voltage using an external RC filter circuit. This was in order to control the fan of the ceiling-mounted air-conditioning units, whose fan controller accepts a voltage of between 0 and 10 volts.

An interesting feature of this module is that it has its own binary protocol to allow for remote control, which is how the air-conditioning service can directly control the fan speeds via the ceiling-mounted nodes:

#include "base_module.h" #include <HardwarePWM.h> class PwmModule {    static HardwarePWM* hw_pwm;    static Vector<int> duty;    static uint8 pinNum;    static Timer timer;    static uint8* pins; public:    static bool initialize();    static bool start(); static ...
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