-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRelayOutput.h
57 lines (42 loc) · 1.27 KB
/
RelayOutput.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* Copyright (C) 2015 Willi Menapace <willi.menapace@gmail.com>, Simone Lorengo <simone@lorengo.org> - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by Simone Lorengo <simone@lorengo.org>
*/
#ifndef RELAY_OUTPUT_INCLUDED
#define RELAY_OUTPUT_INCLUDED
#include "GlobalDefines.h"
#ifdef ONBOARD
#include "Output.h"
/**
* Output corrispondente a un attuatore a relè
*/
class RelayOutput : public Output {
private:
OutputType type;
long lastOutputValue;
unsigned char relayPin;
public:
OutputType getType();
/**
* Imposta un valore di output sull'output corrente (spento 0, acceso 1)
*/
void performOutput(long value);
/**
* @return l'ultimo valore inviato in output sull'output corrente
*/
long getLastOutputValue();
/**
* Verifica ed eventualmente corregge il valore dell'output reale basandosi sull'ultimo impostato
* @return valore corrente corretto. Se FALSE, esegue automaticamente la correzione del valor
*/
bool check();
/**
* Costruisce un output di tipo RELAY
*
* @param relayDigitalPin Pin corrispondente all'output
*/
RelayOutput(int relayDigitalPin);
};
#endif //ONBOARD
#endif // RELAY_OUTPUT_INCLUDED