• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Problems with Galileo Board and Adafruit PWM driver using Arduino 1.5.3

Status
Not open for further replies.

Beans

New Member
I am having difficulties with using the Adafruit library with the Galileo board. The example code that they have provided should work, but there are errors for days, mainly with a wire1 variable from Wire.h. I am using the Adafruit 16 channel 12 bit PWM driver, because I will ultimately need to use more than 10 servo motors. I have attached the Adafruit library to the post.

Also, with just using a pin on the Galileo Board, the code (without using the PWM driver) should make the servo turn from 0 - 180 degrees, but it only turns slightly over 90 degree. The code that I used is:

#include <Wire.h>
#include <Servo.h>

int servoPin = 9;
Servo myServo;

void setup()
{
myServo.attach(servoPin);


}

void loop()
{
myServo.write(0);
delay(1000);
myServo.write(180);
delay(1000);
}

Is there a problem with the Arduino IDE version or is the Galileo not fully compatible with Arduino like it should be? Or perhaps something else?
 

Attachments

I have no experience with galileo board..but I have used Servo in my projects.
First : servo is a mechanical device.So it may depend on the motor configuration how much it will move
My servo was moving for about 100 deg. another probable problem is that you gave pulses to servo and since it is a mechanical device it cannot work properly and instantaneously. so you can capacitor in parallel wih the servo V and GND.
This will definitly work.
One more thing you can try is that instead of writing values directly to servo write them in steps
like
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}

and i can look into your problem but I dont understand what do you mean by this

"The example code that they have provided should work, but there are errors for days, mainly with a wire1 variable from Wire.h"
 

KeepItSimpleStupid

Well-Known Member
Most Helpful Member
Arduino what?

From the looks of the compile, your using the DUE or the 2560, or some dyxlyexic combo like 2650.

The IDE's are totally different and should contain the Wire1 library.

Your missing the Wire1 library and therefore I'm suspecting the wrong IDE.
 

Beans

New Member
Apologies for the super late reply. Some exams got in the way...

The problem with the Galileo board I figured out...it is still using the Arduino IDE that is in Beta phase, so there are a bit of incompatibilities, even if you include all the correct libraries and define and use all the variables correctly. This is what I meant about the wire1 variable in the Wire.h library.

I also tried the servo code to not write is correctly, but with the for loops - thanks, they do work better.

@KeepItSimpleStupid I am using the Intel Galileo Board, which is a Arduino clone.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top