Rotary Encoder?

Status
Not open for further replies.

djsz

Well-known member
It seems that the Encoder library linked from PJRC won't compile. Here are the errors using the example from the library:

Code:
...\libraries\Encoder/Encoder.h:59: error: ISO C++ forbids declaration of 'IO_REG_TYPE' with no type
...\libraries\Encoder/Encoder.h:59: error: expected ';' before '*' token
...\libraries\Encoder/Encoder.h:60: error: ISO C++ forbids declaration of 'IO_REG_TYPE' with no type
...\libraries\Encoder/Encoder.h:60: error: expected ';' before '*' token
...\libraries\Encoder/Encoder.h:61: error: 'IO_REG_TYPE' does not name a type
...\libraries\Encoder/Encoder.h:62: error: 'IO_REG_TYPE' does not name a type
...\libraries\Encoder/Encoder.h: In constructor 'Encoder::Encoder(uint8_t, uint8_t)':
...\libraries\Encoder/Encoder.h:80: error: 'struct Encoder_internal_state_t' has no member named 'pin1_register'
...\libraries\Encoder/Encoder.h:80: error: 'PIN_TO_BASEREG' was not declared in this scope
...\libraries\Encoder/Encoder.h:81: error: 'struct Encoder_internal_state_t' has no member named 'pin1_bitmask'
...\libraries\Encoder/Encoder.h:81: error: 'PIN_TO_BITMASK' was not declared in this scope
...\libraries\Encoder/Encoder.h:82: error: 'struct Encoder_internal_state_t' has no member named 'pin2_register'
...\libraries\Encoder/Encoder.h:83: error: 'struct Encoder_internal_state_t' has no member named 'pin2_bitmask'
...\libraries\Encoder/Encoder.h:90: error: 'struct Encoder_internal_state_t' has no member named 'pin1_register'
...\libraries\Encoder/Encoder.h:90: error: 'struct Encoder_internal_state_t' has no member named 'pin1_bitmask'
...\libraries\Encoder/Encoder.h:90: error: 'DIRECT_PIN_READ' was not declared in this scope
...\libraries\Encoder/Encoder.h:91: error: 'struct Encoder_internal_state_t' has no member named 'pin2_register'
...\libraries\Encoder/Encoder.h:91: error: 'struct Encoder_internal_state_t' has no member named 'pin2_bitmask'
...\libraries\Encoder/Encoder.h:91: error: 'DIRECT_PIN_READ' was not declared in this scope
...\libraries\Encoder/Encoder.h: In static member function 'static void Encoder::update(Encoder_internal_state_t*)':
...\libraries\Encoder/Encoder.h:373: error: 'struct Encoder_internal_state_t' has no member named 'pin1_register'
...\libraries\Encoder/Encoder.h:373: error: 'struct Encoder_internal_state_t' has no member named 'pin1_bitmask'
...\libraries\Encoder/Encoder.h:373: error: 'DIRECT_PIN_READ' was not declared in this scope
...\libraries\Encoder/Encoder.h:374: error: 'struct Encoder_internal_state_t' has no member named 'pin2_register'
...\libraries\Encoder/Encoder.h:374: error: 'struct Encoder_internal_state_t' has no member named 'pin2_bitmask'

Any ideas?
 
The problem is that the library needs to be rewritten for the Teensy 3.0, the list of boards supported is on the web page you linked.

The FlexTimer module (FTM) is described in chapter 35 of the processor reference manual. It has hardware support for quadrature decoding.
 
Status
Not open for further replies.
Back
Top