DCC-EX Simple Throttle
Simple throttle for a DCC-EX CommandStation
Loading...
Searching...
No Matches
/home/runner/work/DCCEXSimpleThrottle/DCCEXSimpleThrottle/Rotary.h
Go to the documentation of this file.
1/*
2 * Rotary encoder library for Arduino.
3 */
4
5#ifndef rotary_h
6#define rotary_h
7
8#include "Arduino.h"
9
10// Enable this to emit codes twice per step.
11// #define HALF_STEP
12
13// Enable weak pullups
14#define ENABLE_PULLUPS
15
16// Values returned by 'process'
17// No complete step yet.
18#define DIR_NONE 0x0
19// Clockwise step.
20#define DIR_CW 0x10
21// Anti-clockwise step.
22#define DIR_CCW 0x20
23
24class Rotary
25{
26 public:
27 Rotary(char, char);
28 // Process pin(s)
29 unsigned char process();
30 private:
31 unsigned char state;
32 unsigned char pin1;
33 unsigned char pin2;
34};
35
36#endif
37
Definition Rotary.h:25
unsigned char pin1
Definition Rotary.h:32
unsigned char pin2
Definition Rotary.h:33
unsigned char state
Definition Rotary.h:31
unsigned char process()
Definition Rotary.cpp:141