-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencoder.h
More file actions
30 lines (17 loc) · 770 Bytes
/
Copy pathencoder.h
File metadata and controls
30 lines (17 loc) · 770 Bytes
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
// this is a base input class, this class will not access any of the other
// files, other files will include this file this file doesnt need to include
// any other file in this project
#ifndef ENCODER_H // these insure that the file doesnt get imported again
#define ENCODER_H
#include <Arduino.h>
// Encoder namespace to encapsulate everything
namespace Encoder {
// Initialize the encoder pins and state
void init();
// Run inside the main loop to detect encoder changes
void loop();
// Register a callback function to be called on encoder rotation
typedef void (*EncoderCallback)(int delta);
void register_encoder_callback(EncoderCallback callback);
} // namespace Encoder
#endif // ENCODER_H