desk-light with brightness and color temperature (remote) control
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
439 B

#ifndef ENCODER_H_
#define ENCODER_H_
#ifndef F_CPU
#define F_CPU 16000000
#endif
#define ENC_PORT PORTC
#define ENC_PORT_BTN PORTD
#define ENC_PIN_A PC1
#define ENC_PIN_B PC2
#define ENC_PIN_BTN PD2
#define INPUT_A (PINC & 1<<ENC_PIN_A)
#define INPUT_B (PINC & 1<<ENC_PIN_B)
#define INPUT_BTN (PIND & 1<<ENC_PIN_BTN)
void encoder_init( void );
int encoder_read( void );
int encoder_read_btn( void );
#endif