I am trying to turn on and control a Firgelli L12 -I actuator using a Adafruit Motor Shield connected on top of a Ardunio Mega 2560.
I connect the red/black/white set of wires from the actuator to the set of pins labeled as servo (there are two sets of three pins labeled as servo 1 and servo 2). There are no examples I could find for Servo control using Adafruit on top an Arduino!!
Could someone please elaborate on this a bit, so I can find the right connections from firgelli to the Shield, How would I connect it if I do not have the Shield, and then what code should I use?
OK, I pulled out the adafruit and connected the actuator directly to the arduino. Then I connected the red, black and white on the actuator to 5V, GND and pin9 on the arduino, respectively. as soon as I connected them, the actuator started working. However I had not even opened the arduino software!! How do I get control over the actuator? so I can program it? Thank you.
The guy below seems to have the same issue. I suggest you remove the Adafruit Motor Shield and wire the actuator to the mega similar to the servo in the below diagram. Bottom is some very basic arduino servo test code that accepts us servo control values like 1500 sent from the serial monitor. The actuator data sheet says that a us value like 1000 would fully retract the actuator and 2000 would fully extend the actuator.
// zoomkat 10-14-11 serial servo test
// use a microseconds value like 1500 in serial monitor
// for IDE 0022 and later
// Powering a servo from the arduino usually DOES NOT WORK.
String readString;
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
Serial.begin(9600);
myservo.writeMicroseconds(1500); //set initial servo position if desired
myservo.attach(7); //the pin for the servo control
Serial.println("servo-test-22"); // so I can keep track of what is loaded
}
void loop() {
while (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the string readString
delay(2); // allow buffer to fill with next character
}
if (readString.length() >0) {
Serial.println(readString); //so you can see the captured string
myservo.writeMicroseconds(readString.toInt()); //convert readString to number for servo
readString=""; //empty for next input
}
}
I actually re-installed the adafruit shield on top of arduino. I have not yet opened the arduino software; but when I connect the actuator first of all on pins "servo 1" nothing happens, but on "servo 2" it starts moving instantly!! why is that? Basically I do not have control over the movements? I have not compiled any code yet...and why is it not working with "servo 1"?
I actually re-installed the adafruit shield on top of arduino. I have not yet opened the arduino software; but when I connect the actuator first of all on pins "servo 1" nothing happens, but on "servo 2" it starts moving instantly!! why is that? Basically I do not have control over the movements? I have not compiled any code yet...and why is it not working with "servo 1"?
Thank you again!?
Have you contacted adafruit about your issues? They can probably help you with their product.
Yes, I have actually done that as well...awaiting their response!
it is interesting (and frustrating) that the actuator starts moving back and forth even without the arduino software being open. How do I prevent this from occurring !?
it is interesting (and frustrating) that the actuator starts moving back and forth even without the arduino software being open.
What do you mean by "without the arduino software being open"? If you've powered up the Arduino, the software IS running.
Whether or not the Arduino IDE software is running on a different computer, or whether or not the Serial Monitor application is running on a different computer, has no impact on the execution of the code on the Arduino.
OK, but when I am connecting to the "servo1" and "servo2" pins of the AdaFruit, how would I know which pins on the Arduino they are referring to? I guess pin 9 is the signal pin that corresponds to "servo1". What signal pin corresponds to "servo2" then?
On the other hand, are there sample codes regarding the servo actuation? I was checking the code from:
Firstly there is an error with the "refresh"; I am not sure if it is sources from the type of "servo.h" library that I am using. Also, the actuators move slightly and then stop (and it seems that they are in stall position). What is that I need to do about that?
I am using Adafruit Motor Shield V2.
I once connected the servo directly to the Arduino, then I was told (on another forum) that it is the wrong thing to do, and I might burn the Arduino chip. I am using an Arduino Mega 2560.