Pages: [1]   Go Down
Author Topic: Attaching Servos in FirmataStandard / Processing  (Read 964 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 551
Posts: 46257
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Germany
Offline Offline
Newbie
*
Karma: 1
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink

thx,
stefan

Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 19
Posts: 3114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Or better yet, write your own sketch.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

HI Everyone,

I am having the same issue as above - are there any updates?

Thanks,

Bart
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 551
Posts: 46257
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
are there any updates?
Of course not.
Logged

Pages: [1]   Go Up
Jump to: