VizBlocks
Potentiometer.hpp
Go to the documentation of this file.
1
#ifndef POTENTIOMETER_h
2
#define POTENTIOMETER_h
3
4
class
Potentiometer
5
{
6
7
int
EMA_S = 0;
//initialization of EMA S
8
float
EMA_a = 0.6;
9
10
int
_pin;
11
int
_id;
12
13
int
_value;
14
int
_previousReading;
15
16
bool
_inputFlag =
false
;
17
bool
_changeFlag =
false
;
18
19
unsigned
long
_previousTimer;
20
int
_interval = 200;
21
22
void (*_cb)(
Potentiometer
*, uint8_t, uint8_t);
// Callback function
26
int
_read();
30
void
_setValue(
int
x);
31
32
public
:
33
34
static
const
uint8_t
kEventStableUpdate
= 0;
35
static
const
uint8_t
kEventUnstableUpdate
= 1;
36
37
Potentiometer
(
int
pin,
int
id
= 99) : _pin(pin), _id(id);
41
void
setEventHandler(
void
(*
function
)(
Potentiometer
*, uint8_t, uint8_t));
45
int
getValue
();
49
int
getId
();
53
void
check
();
54
};
55
56
#endif
Potentiometer::check
void check()
What does this do?
Potentiometer::kEventStableUpdate
static const uint8_t kEventStableUpdate
Definition:
Potentiometer.hpp:34
Potentiometer
Definition:
Potentiometer.hpp:5
Potentiometer::getId
int getId()
What does this do?
Potentiometer::kEventUnstableUpdate
static const uint8_t kEventUnstableUpdate
Definition:
Potentiometer.hpp:35
Potentiometer::getValue
int getValue()
What does this do?
Generated by
1.8.18