VLCB
Loading...
Searching...
No Matches
LEDUserInterface.h
Go to the documentation of this file.
1// Copyright (C) Sven Rosvall (sven@rosvall.ie)
2// This file is part of VLCB-Arduino project on https://github.com/SvenRosvall/VLCB-Arduino
3// Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
4// The full licence can be found at: http://creativecommons.org/licenses/by-nc-sa/4.0/
5
6#pragma once
7
8#include "LED.h"
9#include "Switch.h"
10#include "Service.h"
11#include "vlcbdefs.hpp"
12
13namespace VLCB
14{
23{
24public:
25 LEDUserInterface(byte greenLedPin, byte yellowLedPin, byte pushButtonPin);
26
28 virtual VlcbServiceTypes getServiceID() const override { return SERVICE_ID_NONE; };
29 virtual byte getServiceVersionID() const override { return 1; };
30
31 bool isButtonPressed();
32 virtual void process() override;
33 virtual void processAction(const Action &action) override;
35
36private:
37 LED greenLed;
38 LED yellowLed;
39 Switch pushButton;
40
41 bool resetRequested();
42 void handleAction(const Action &action);
43 void checkRequestedAction();
44
45 void indicateMode(VlcbModeParams mode);
46};
47
48}
virtual void processAction(const Action &action) override
Called when there is an action available.
Definition LEDUserInterface.cpp:46
virtual VlcbServiceTypes getServiceID() const override
Return a unique ID for this service.
Definition LEDUserInterface.h:28
virtual void process() override
This method that be called regularly from the VLCB core to let the service perform regular tasks.
Definition LEDUserInterface.cpp:31
bool isButtonPressed()
Definition LEDUserInterface.cpp:26
LEDUserInterface(byte greenLedPin, byte yellowLedPin, byte pushButtonPin)
Definition LEDUserInterface.cpp:20
virtual byte getServiceVersionID() const override
Return the version of the service specification implemented by this service.
Definition LEDUserInterface.h:29
class to encapsulate a non-blocking LED
Definition LED.h:29
Interface base class for all VLCB services.
Definition Service.h:25
Definition Switch.h:20
Definition AbstractEventTeachingService.cpp:13
An action to be performed.
Definition Controller.h:51
VlcbModeParams
Definition vlcbdefs.hpp:562
VlcbServiceTypes
Definition vlcbdefs.hpp:487
@ SERVICE_ID_NONE
Definition vlcbdefs.hpp:491