Commanders
Arduino buttons/bus library
ButtonsCommanderAnalogPushesItem.cpp
1
/*************************************************************
2
project: <Commanders>
3
author: <Thierry PARIS>
4
description: <Item button from analog array of push buttons with debounce.>
5
*************************************************************/
6
7
#include <
Commanders.h
>
8
#ifndef NO_BUTTONSCOMMANDER
9
#ifndef NO_BUTTONSCOMMANDERANALOGPUSHES
10
11
bool
ButtonsCommanderAnalogPushesItem::IsPushed
(
int
inCurrentValue)
12
{
13
if
(inCurrentValue >= this->analogValue - this->readingTolerancy && inCurrentValue <= this->analogValue + this->readingTolerancy)
14
return
true
;
15
16
return
false
;
17
}
18
19
#ifdef COMMANDERS_PRINT_COMMANDERS
20
void
ButtonsCommanderAnalogPushesItem::printCommander()
21
{
22
Serial.print(F(
"Push Id: "
));
23
Serial.print(this->
Id
);
24
Serial.print(F(
" / value: "
));
25
Serial.println(this->analogValue);
26
}
27
#endif
28
#endif
29
#endif
ButtonsCommanderButton::Id
unsigned long Id
Definition:
ButtonsCommanderButton.hpp:19
ButtonsCommanderAnalogPushesItem::IsPushed
bool IsPushed(int inCurrentValue)
Definition:
ButtonsCommanderAnalogPushesItem.cpp:11
Commanders.h
src
ButtonsCommanderAnalogPushesItem.cpp
Generated on ven. juil. 13 2018 22:02:23 for Commanders by
1.2.10