1 Reply Latest reply on Jul 14, 2014 10:28 AM by Intel_Jesus

    Adafruit Motor Shield v2

    tfx

      Let me know if anyone gets this working. The current libraries fail on "Wire" libraries

       

      The error:

      C:\Users\thoug_000.HAWKING\Desktop\Galileo-arduino-1.5.3\libraries\Adafruit_Motorshield\Adafruit_MotorShield.cpp: In member function 'void Adafruit_MotorShield::begin(uint16_t)':

      C:\Users\thoug_000.HAWKING\Desktop\Galileo-arduino-1.5.3\libraries\Adafruit_Motorshield\Adafruit_MotorShield.cpp:46:3: error: 'Wire1' was not declared in this scope

        • 1. Re: Adafruit Motor Shield v2
          Intel_Jesus

          Hi tfx,

           

          The adafruit motor shield is not on our supported list of shields, Intel® Galileo Shields List. adding the following changes to the cpp files might help you compile your code. I suggest giving this a try, i had no issues using dc motors, but i am not sure about servos.

           

          The file paths might be slightly different depending on your file location.

           

          In the C:\arduino-1.5.3\libraries\AdafruitMotorShield\Adafruit_MotorShield.cpp change line 18 to 30.

           

          #if (ARDUINO >= 100)
          #include "Arduino.h"
          #else
          #include "WProgram.h"
          #endif
          #include <Wire.h>
          #include "Adafruit_MotorShield.h"
          #include <Adafruit_PWMServoDriver.h>
          #ifdef __AVR__
          #define WIRE Wire
          #else // Arduino Due
          #define WIRE Wire1
          #endif
          

           

          to

           

          #if (ARDUINO >= 100)
          #include "Arduino.h"
          #else
          #include "WProgram.h"
          #endif
          #include <Wire.h>
          #include "Adafruit_MotorShield.h"
          #include <Adafruit_PWMServoDriver.h>
          #define WIRE Wire
          

           

          Also change the following in the C:\arduino-1.5.3\libraries\AdafruitMotorShield\utility\Adafruit_PWMServoDriver.cpp line 18 to 24

           

          #include <Adafruit_PWMServoDriver.h>
          #include <Wire.h>
          #ifdef __AVR__
          #define WIRE Wire
          #else // Arduino Due
          #define WIRE Wire1
          #endif
          

           

          to

           

          #include <Adafruit_PWMServoDriver.h>
          #include <Wire.h>
          #define WIRE Wire
          

           

          Regards,

          Intel_Jesus