Java wrapper for Firmata v2.1


I have tried the available java wrapper for the firmata available from the Arduino website.

I was able to play with pinMode and digitalWrite. However this wrapper lacks support for the latest Firmata v2.1 with servos and other stuff.

Is there any Java wrapper for Firmata v2.1 available?

Here is code snippet with servo support I wrote last week.

public class ArduinoV21 extends Arduino {

public static final int ANALOG = 2;
public static final int PWM = 3;
public static final int SERVO = 4;

private final int SERVO_CONFIG = 0x70;

public ArduinoV21(PApplet parent, String iname, int irate) {
super(parent, iname, irate);

public ArduinoV21(PApplet parent, String iname) {
super(parent, iname);

public void attach(int pin) {
pinMode(pin, SERVO);

public void attach(int pin, int minPulse, int maxPulse) {
pinMode(pin, SERVO);
servoConfig(pin, minPulse, maxPulse, 0);

public void detach(int pin) {
pinMode(pin, INPUT);

public void writeAngle(int pin, int value) {
analogWrite(pin, value);

public void servoConfig(int pin, int minPulse, int maxPulse, int angle) {
serial.write(pin & 0x7F);
serial.write(minPulse & 0x7F);
serial.write(minPulse >> 7);
serial.write(maxPulse & 0x7F);
serial.write(maxPulse >> 7);
serial.write(angle & 0x7F);
serial.write(angle >> 7);