6 Replies Latest reply on Jan 25, 2016 1:33 PM by RoboBill

    Uploading a sketch with Servo.h and Encoder.h gives compile errors

    RoboBill

      My robot uses Parallax motors and quadrature encoders. Originally I used an Uno and it ran fine with the Servo.h and Encoder.h included.  Now I want to use my new Galileo2. Problem is, when I try to upload the following sketch:

       

      //--------------------------------------------------------------------------------------

      // Sweep Sample - Copyright (c) 2012 Dimension Engineering LLC

      // See license.txt for license details.

      #include <Encoder.h>

      #include <Servo.h>

      // Change these pin numbers to the pins connected to your encoder.

      //   Best Performance: both pins have interrupt capability

      //   Good Performance: only the first pin has interrupt capability

      //   Low Performance:  neither pin has interrupt capability

      Encoder Left_Encoder(2, 4);

      Encoder Right_Encoder(3, 5);

      //   avoid using pins with LEDs attached

      Servo Left_Motor, Right_Motor, Actuator, Fans; // We'll name the Sabertooth servo channel objects Left Motor and Right Motor.

                      // For how to configure the Sabertooth, see the DIP Switch Wizard for

                      //   http://www.dimensionengineering.com/datasheets/SabertoothDIPWizard/start.htm

                      // Be sure to select RC Microcontroller Mode for use with this sample.

                      //

                      // Connections to make:

                      //   Arduino Pin 9  ->  Sabertooth S1

                      //   Arduino Pin 10 ->  Sabertooth S2

                      //   Arduino GND    ->  Sabertooth 0V

                      //   Arduino VIN    ->  Sabertooth 5V (OPTIONAL, if you want the Sabertooth to power the Arduino)

                      //

                      // Sabertooth accepts servo pulses from 1000 us to 2000 us.

                      // We need to specify the pulse widths in attach(). 0 degrees will be full reverse, 180 degrees will be

                      // full forward. Sending a servo command of 90 will stop the motor. Whether the servo pulses control

                      // the motors individually or control throttle and turning depends on your mixed mode setting.

      // Notice these attach() calls. The second and third arguments are important.

      // With a single argument, the range is 44 to 141 degrees, with 92 being stopped.

      // With all three arguments, we can use 0 to 180 degrees, with 90 being stopped.

       

      // the rest of the code here ...blah blah blah

      blah blah blah

      blah blah blah

      //--------------------------------------------------------------------

       

      , I get the following error

       

       

       

      WARNING: library Servo claims to run on [i586-uclibc] architecture(s) and may be incompatible with your current board which runs on [i586] architecture(s).

       

       

      In file included from C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:46:0,

                       from sketch_jan23a.ino:5:

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/utility/interrupt_pins.h:166:2: error: #error "Interrupts are unknown for this board, please add to this code"

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/utility/interrupt_pins.h:169:2: error: #error "Encoder requires interrupt pins, but this board does not have any :("

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/utility/interrupt_pins.h:170:2: error: #error "You could try defining ENCODER_DO_NOT_USE_INTERRUPTS as a kludge."

      In file included from sketch_jan23a.ino:5:0:

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:61:11: error: 'IO_REG_TYPE' does not name a type

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:62:11: error: 'IO_REG_TYPE' does not name a type

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:63:2: error: 'IO_REG_TYPE' does not name a type

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:64:2: error: 'IO_REG_TYPE' does not name a type

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:135:50: error: 'CORE_NUM_INTERRUPT' was not declared in this scope

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h: In constructor 'Encoder::Encoder(uint8_t, uint8_t)':

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:82:11: error: 'struct Encoder_internal_state_t' has no member named 'pin1_register'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:82:46: error: 'PIN_TO_BASEREG' was not declared in this scope

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:83:11: error: 'struct Encoder_internal_state_t' has no member named 'pin1_bitmask'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:83:45: error: 'PIN_TO_BITMASK' was not declared in this scope

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:84:11: error: 'struct Encoder_internal_state_t' has no member named 'pin2_register'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:85:11: error: 'struct Encoder_internal_state_t' has no member named 'pin2_bitmask'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:92:31: error: 'struct Encoder_internal_state_t' has no member named 'pin1_register'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:92:54: error: 'struct Encoder_internal_state_t' has no member named 'pin1_bitmask'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:92:66: error: 'DIRECT_PIN_READ' was not declared in this scope

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:93:31: error: 'struct Encoder_internal_state_t' has no member named 'pin2_register'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:93:54: error: 'struct Encoder_internal_state_t' has no member named 'pin2_bitmask'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:93:66: error: 'DIRECT_PIN_READ' was not declared in this scope

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h: In static member function 'static void Encoder::update(Encoder_internal_state_t*)':

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:271:40: error: 'struct Encoder_internal_state_t' has no member named 'pin1_register'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:271:60: error: 'struct Encoder_internal_state_t' has no member named 'pin1_bitmask'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:271:72: error: 'DIRECT_PIN_READ' was not declared in this scope

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:272:40: error: 'struct Encoder_internal_state_t' has no member named 'pin2_register'

      C:\Users\username\Documents\Arduino\libraries\Encoder-master/Encoder.h:272:60: error: 'struct Encoder_internal_state_t' has no member named 'pin2_bitmask'

      Error compiling.

       

       

      Any suggestions?

       

      Thanks

       

      RoboBill