Rotary encoder with easyC library 1.0.0
Library for the rotary encoder witc easyC created by Soldered
Loading...
Searching...
No Matches
Rotary-encoder-easyC-SOLDERED.h
Go to the documentation of this file.
1
12#ifndef __ROTARY__
13#define __ROTARY__
14
15#include "Arduino.h"
17
18// Define states of the rotary encoder and button
19#define ROTARY_IDLE 0
20#define BTN_CLICK 1
21#define BTN_DOUBLE_CLICK 2
22#define BTN_LONG_PRESS 3
23#define BTN_LONG_RELEASE 4
24#define ROTARY_CCW 5
25#define ROTARY_CW 6
26
27class Rotary : public EasyC
28{
29 public:
30 Rotary();
31 long getCount();
32 byte getState();
33 void resetCounter();
34
35
36 protected:
37 void initializeNative();
38
39 private:
40 void getData();
43};
44
45#endif
Definition easyC.hpp:22
Definition Rotary-encoder-easyC-SOLDERED.h:28
Rotary()
Rotary specific native constructor.
Definition Rotary-encoder-easyC-SOLDERED.cpp:18
byte getState()
Get state of the rotary encoder.
Definition Rotary-encoder-easyC-SOLDERED.cpp:74
long rotaryCounter
Definition Rotary-encoder-easyC-SOLDERED.h:41
byte rotaryState
Definition Rotary-encoder-easyC-SOLDERED.h:42
void initializeNative()
Overloaded function for virtual in base class to initialize sensor specific.
Definition Rotary-encoder-easyC-SOLDERED.cpp:26
long getCount()
Get counter from rotary encoder breakout.
Definition Rotary-encoder-easyC-SOLDERED.cpp:57
void getData()
Get data from the breakout and store them in class variables.
Definition Rotary-encoder-easyC-SOLDERED.cpp:33
void resetCounter()
Reset the internal counter on the breakout.
Definition Rotary-encoder-easyC-SOLDERED.cpp:83
Basic funtions for easyC libraries.