-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrotenc.h
27 lines (20 loc) · 951 Bytes
/
rotenc.h
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
/************************************************************************/
/* */
/* Reading rotary encoder */
/* one, two and four step encoders supported */
/* */
/* Author: Peter Dannegger */
/* */
/************************************************************************/
#include <stdint.h>
#ifndef ROTENC_H
#define ROTENC_H
#define PHASE_A (PIND & 1<<PD4)
#define PHASE_B (PIND & 1<<PD5)
// Initialisierung: muss am Anfang des Programms stehen
void encode_init( void );
// Interrupt Routine: muss regelmäßig aufgerufen werden
void encode_isr( void );
// Drehgeber auslesen
int8_t encode_read( void );
#endif