Pages: [1]   Go Down
Author Topic: Servo with Firmata and Processing  (Read 1490 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey People, I'm searching now for amazing 3hours  smiley-eek, but I hadn't found ANYTHING, please help me guys!!!

I have an Arduino and I uploaded StandardFirmata on the Arduino.

On the other hand I'm working with Processing, and now my question:

How can I handle a Servo in Processing?
It has to work because there are Servo-Tags in the Source of StandardFirmata.

I tried PWM-Functions in Processing, with the Standard-Firmata uploaded on the Arduino but nothing works  smiley-sad-blue.
I tried this:

import processing.serial.*;
import cc.arduino.*;

int reservedPin = 9; //It's a PWM-Pin
Arduino arduino;

void setup()
  arduino = new Arduino(this, Arduino.list()[0], 57600);

void draw() {

void mouseReleased() {
  for(int ia=0;ia<256;ia++) {
    arduino.analogWrite(reservedPin, ia);  
    if(ia==255) {

When I execute the program which is called like "firmata_test" from, I can choose PWM in the Pin-List and also Servo and then the hole thing works.
So, we can count the StandardFirmata out!
But how I have to write the source so that the function works????

Please help me!
Thank you very much!

« Last Edit: February 10, 2011, 08:18:08 am by GraKa » Logged

Seattle, WA USA
Offline Offline
Brattain Member
Karma: 644
Posts: 50524
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to set the mode of the pin that the servo is attached to, to SERVO.

Servos don't use PWM, by the way.

Pages: [1]   Go Up
Jump to: