Go Down

Topic: Attaching Servos in FirmataStandard / Processing (Read 1 time) previous topic - next topic

huggybigbear

Hi Guys,
I'm having trouble attaching servos to Arduino when using the FirmataStandard library,  then controlling them from Processing.
I'm trying to declare the pin mode for 2 and 3 to be servos :


Code: [Select]

import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
int aPin=0, s1=2,s2=3;
int data;

void setup() {
  size(512, 200);

  arduino = new Arduino(this, Arduino.list()[2], 57600);
  arduino.pinMode(aPin, Arduino.INPUT);
  arduino.pinMode(s1, Arduino.SERVO);
  arduino.pinMode(s2, Arduino.SERVO);
 
}


but that only seems to treat them as PWM - constant buzzing and 600mA current draw constantly.

I have Firmata 2.2 installed, and when using the Firmata Test.exe program, my servos behave themselves properly.
Where abouts should I be declaring the pinMode, as i'm obviously doing something wrong!

Thanks in advance!
Fergal

PaulS

Did you look at the various sketches delivered with the Firmata library? Did you by any chance notice that there is one specifically for servo usage? By any chance, did you observe that it is not named StandardFirmata.pde/ino?

huggybigbear

Yes indeed I noticed that, thanks.
It works just fine with the FirmataServo.pde.

Unfortunately I also want to read sensors from the analog pins, so the servo only library is insufficient for my needs..

I understand from reading the Firmata literature, that FirmataStandard supports servos in v2.2
(and as I mentioned, with standard loaded into the Arduino Mega, the FirmataTest.exe program works just fine.

Its the setPinMode seems to be the issue.

cheers

tres

hi all,

i have the same problem. i spent hours looking for a solution online but all i could find were unsolved threads just like this one =)
so it seems nobody knows how to properly control a servo AND read values from an analog in at the same time via standardfirmata?

please help if you know the solution, it has to be possible ;)

thx,
stefan


dxw00d

Try asking the Firmata developers. http://firmata.org

Or better yet, write your own sketch.

Go Up