VLCB
Toggle main menu visibility
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
13
namespace
VLCB
14
{
22
class
LEDUserInterface
:
public
Service
23
{
24
public
:
25
LEDUserInterface
() {}
26
LEDUserInterface
(
byte
greenLedPin,
byte
yellowLedPin,
byte
pushButtonPin);
27
28
void
setGreenLedPin
(
byte
pin);
29
void
setYellowLedPin
(
byte
pin);
30
void
setSwitchPin
(
byte
pin);
31
33
virtual
VlcbServiceTypes
getServiceID
()
const override
{
return
SERVICE_ID_NONE
; }
34
virtual
byte
getServiceVersionID
()
const override
{
return
1; }
35
36
bool
isButtonPressed
();
37
virtual
void
process
()
override
;
38
virtual
void
processAction
(
const
Action
&action)
override
;
40
41
private
:
42
LED
greenLed;
43
LED
yellowLed;
44
Switch
pushButton;
45
46
bool
resetRequested();
47
void
checkRequestedAction();
48
49
void
indicateMode(
VlcbModeParams
mode);
50
};
51
52
}
LED.h
Service.h
Switch.h
VLCB::LEDUserInterface::processAction
virtual void processAction(const Action &action) override
Called when there is an action available.
Definition
LEDUserInterface.cpp:61
VLCB::LEDUserInterface::getServiceID
virtual VlcbServiceTypes getServiceID() const override
Return a unique ID for this service.
Definition
LEDUserInterface.h:33
VLCB::LEDUserInterface::setYellowLedPin
void setYellowLedPin(byte pin)
Definition
LEDUserInterface.cpp:31
VLCB::LEDUserInterface::setGreenLedPin
void setGreenLedPin(byte pin)
Definition
LEDUserInterface.cpp:26
VLCB::LEDUserInterface::setSwitchPin
void setSwitchPin(byte pin)
Definition
LEDUserInterface.cpp:36
VLCB::LEDUserInterface::isButtonPressed
bool isButtonPressed()
Definition
LEDUserInterface.cpp:41
VLCB::LEDUserInterface::getServiceVersionID
virtual byte getServiceVersionID() const override
Return the version of the service specification implemented by this service.
Definition
LEDUserInterface.h:34
VLCB::LEDUserInterface::LEDUserInterface
LEDUserInterface()
Definition
LEDUserInterface.h:25
VLCB::LED
class to encapsulate a non-blocking LED
Definition
LED.h:29
VLCB::Service
Interface base class for all VLCB services.
Definition
Service.h:25
VLCB::Switch
Definition
Switch.h:20
VLCB
Definition
AbstractEventTeachingService.cpp:13
VLCB::process
void process()
Definition
VLCB.cpp:192
VLCB::Action
An action to be performed.
Definition
Controller.h:90
vlcbdefs.hpp
VlcbModeParams
VlcbModeParams
Definition
vlcbdefs.hpp:562
VlcbServiceTypes
VlcbServiceTypes
Definition
vlcbdefs.hpp:487
SERVICE_ID_NONE
@ SERVICE_ID_NONE
Definition
vlcbdefs.hpp:491
src
LEDUserInterface.h
Generated by
1.18.0