SimpleDigitalFirmata doesn't work

Hi everybody, I'm quite new to Arduino and it's my first post on the forum. I'm trying to interface Arduino with Processing and it works with the analog inputs, but when it comes to the digitals, they never works. When I run the firmata test everything is ok, the digital inputs goes HIGH and LOW, but when i run processing they don't. I thought that the error was in the code, so i tried with the given examples, and it's the same: anlog works, digital don't. The next thing I tried was to upload on the board the SimpleDigitalFirmata, but when i try, it says there's an error at this line:

"outputPort(i, readPort(i));"

and report this:

/Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata/Boards.h: In function 'void loop()': /Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata/Boards.h:270: error: too few arguments to function 'unsigned char readPort(byte, byte)' SimpleDigitalFirmata:54: error: at this point in file

i don't really understand the meaning of this, can someone please help? i use the default SimpleDigitalFirmata code, so the problem might be in some files around the mac?

I'm quite new to Arduino and it's my first post on the forum.

Which Arduino do you have?

I'm trying to interface Arduino with Processing and it works with the analog inputs, but when it comes to the digitals, they never works.

Sorry my crystal ball has a crack in it. I can't see your Processing or Arduino code.

When I run the firmata test everything is ok, the digital inputs goes HIGH and LOW, but when i run processing they don't.

What firmata test? The firmata sketch on the Arduino is reacting to serial input. If the digital pins are functioning, it is because the external input is good.

If they don't work with your Processing sketch, the problem is with your sketch.

The next thing I tried was to upload on the board the SimpleDigitalFirmata, but when i try, it says there's an error at this line

This message:

error: too few arguments to function 'unsigned char readPort(byte, byte)'

is telling you that the readPort() function takes two arguments.

This call:

outputPort(i, readPort(i));

only supplies one argument. It doesn't take a rocket surgeon to see what the problem is.

This issue has been discussed before. A search for "readPort" should get you to the fix.

i use the default SimpleDigitalFirmata code, so the problem might be in some files around the mac?

The problem seems to be that your shift key doesn't work very well.

Which Arduino do you have?

Arduino Uno

Sorry my crystal ball has a crack in it. I can’t see your Processing or Arduino code.

I didn’t post my code because as i wrote before i’ve been using the Processing “arduino examples”, they are standards, i didn’t wrote them, but if you want to see, this is the Input one:

import processing.serial.*;

import cc.arduino.*;

Arduino arduino;

color off = color(4, 79, 111);
color on = color(84, 145, 158);

void setup() {
  size(470, 280);
  arduino = new Arduino(this, Arduino.list()[0], 57600);
  
  for (int i = 0; i <= 13; i++)
    arduino.pinMode(i, Arduino.INPUT);
}

void draw() {
  background(off);
  stroke(on);
  
  for (int i = 0; i <= 13; i++) {
    if (arduino.digitalRead(i) == Arduino.HIGH)
      fill(on);
    else
      fill(off);
      
    rect(420 - i * 30, 30, 20, 20);
  }
  
  for (int i = 0; i <= 5; i++) {
    ellipse(280 + i * 30, 240, arduino.analogRead(i) / 16, arduino.analogRead(i) / 16);
  }
}

If they don’t work with your Processing sketch, the problem is with your sketch.

That’s what i was thinking too, so i tried with the default examples and nor the digitalInput, nor the digitalOutput work at all.

The problem seems to be that your shift key doesn’t work very well.

man I wish that the problem could be only that, I’ve been spending hours to figure out what’s wrong

Ok, I got this to work using the AllInputsFirmata sketch instead of the StandardFirmata on the Arduino Uno board, replacing the line

    sendPort(i, readPort(i));

with this:

    sendPort(i, readPort(i, 0xff));

I don't know what the 0xff does (i think is a c command),found it in another code, but it works with processing, analog and digital, Thanks PaulS for the readPort tip.

There's still one question i have: why the Firmata examples like the AllInputsFirmata have that sendPort(or readPort) line compiled with only one argument?