9#include <RotaryEncoder.h>
31 : lcd::ViewBase(
display,
"HardwareTestView")
62 virtual void tick(
const bool& forceRedraw) {
63 auto direction =
encoder->getDirection();
64 auto click =
encoder->getNewClick();
75 if (direction == RotaryEncoder::Direction::CLOCKWISE) {
83 if (direction == RotaryEncoder::Direction::COUNTERCLOCKWISE) {
85 display->print(
"COUNTERCLOCKWISE");
98 timeBuf.tm_year = rtcTime.year - 1900;
99 timeBuf.tm_mon = rtcTime.mon - 1;
100 timeBuf.tm_mday = rtcTime.mday;
101 timeBuf.tm_hour = rtcTime.hour;
102 timeBuf.tm_min = rtcTime.min;
103 timeBuf.tm_sec = rtcTime.sec;
104 strftime(buf, 21,
"R %d.%m.%y %T", &timeBuf);
108 static time_t lastTime = 0;
109 time_t now = time(NULL);
110 if (now != lastTime) {
111 strftime(buf, 21,
"S %d.%m.%y %T", localtime_r(&now, &timeBuf));
#define COIL_PIN
GPIO the coil of the safe is connected to.
Definition: HardwareConfiguration.h:10
Main view testing all connected hardware.
Definition: HardwareTestView.h:17
virtual void activate()
called as soon as the view becomes active
Definition: HardwareTestView.h:50
HardwareTestView(LiquidCrystal_PCF8574 *display, RotaryEncoder *encoder)
Construct a vie object.
Definition: HardwareTestView.h:30
HardwareTestView(HardwareTestView &&other) noexcept=delete
Move constructor.
HardwareTestView(const HardwareTestView &other)=delete
Copy constructor - not available.
RotaryEncoder * encoder
pointer to the encoder instance
Definition: HardwareTestView.h:22
virtual void tick(const bool &forceRedraw)
called during the loop function
Definition: HardwareTestView.h:62
views::ConfigurationServerView configurationServerView & display
Definition: main.cpp:57
Definition: ConfigurationServerView.h:10