Thanks for the post. Sorry
Thanks for the post. Sorry about the lack of information. I thought I had searched google a lot but I guess I had missed that one. That link actually answered my initial problem. When using Processing and standard firmata the initialization for the servos has to be
arduino.pinMode(servopin, 5);
instead of
arduino.pinMode(servopin, 4);
Anyways that got the servos to move with the standard firmata. Now I have noticed another problem. When using standard firmata, a servo control program on Processing moves the servo from 0 to 90 degrees. I loaded the servo firmata onto the arduino uno and ran that same program and the servo moved from 0 to 180 degrees. Here is the code for that simple program.
import processing.serial.;
import cc.arduino.;
Arduino arduino;
int pos=0; //servo position in degrees (0…180)
void setup()
{
size(360, 200);
arduino = new Arduino(this, Arduino.list()[4], 57600); //your offset may vary
arduino.pinMode(9,5);
}
void draw()
{
// read mouseX coordinate
int newPos = constrain(mouseX/2,0,180); // update bg & servo position if mouseX changed
if(newPos != pos)
{
background(newPos);
arduino.analogWrite(9, newPos);
println (" newPos = " + newPos );
pos=newPos; //update servo position storage variable
}
}
I added +90 to the output of the servo. This made the sweep reach from about 0 to 180, but the motor gave up its torque at each end probably because the input value went over what the servo will accept as a value? (I’m speculating) This trick didn’t fix the problem because I added it to the biped control and the motion was not similar to that of the servo firmata tests.