45 bool init_EMS22A(int8_t init_ENCODER_ABS_CS, int8_t init_ENCODER_ABS_CLK, int8_t init_ENCODER_ABS_DO, uint16_t init_sampling_period_ms)
74 for (
int i=0; i<16; i++) {
96 const unsigned long tnow =
millis();
107 const uint16_t enc_pos = dat >> 6;
108 const uint8_t enc_status = dat & 0x3f;
117 Serial.write((uint8_t*)&tx,
sizeof(tx));
void calc_and_update_checksum()
void pinMode(uint8_t, uint8_t)
void delayMicroseconds(unsigned int us)
bool init_EMS22A(int8_t init_ENCODER_ABS_CS, int8_t init_ENCODER_ABS_CLK, int8_t init_ENCODER_ABS_DO, uint16_t init_sampling_period_ms)
uint16_t EMS22A_sampling_period_ms
uint16_t enc_pos
Absolute value read from the encoder (10 bits resolution)
uint8_t enc_status
See EMS22A datasheet for the bit map.
unsigned long EMS22A_last_millis
unsigned long millis(void)
void digitalWrite(uint8_t, uint8_t)