Processing via Firmata digitalRead on Mega pins >15

Hello all,

I'm new to this forum, but have spent I bit of time using the Arduino.

I think the Arduino library (for the Mega) requires updating. I've found it to work very well except for the digitalRead() on pins greater than 15 on the Mega (I'm using the atmega 1280). Here is what I have:

  • ArduinoMega (1280) loaded with StandardFirmata
  • Tested with firmata test program http://firmata.org/wiki/Main_Page (all functionality works)
  • This tells me the problem lies in the Arduino processing library
  • I downloaded the Arduino library from http://nilseuropa.com/?p=139 as the one here Arduino Playground - Processing has an empty library folder (both src folders including the .java file appear identical).
  • All PWM pins (2-13) work
  • digitalWrite(int,int) works for all pins (2-53)
  • digitalRead(int) only works with pins 2-15

My guess is that the problem is in the Arduino.java code. I am not an experienced programmer, and have never touched Java.

If anyone is interested in helping solve this bug let me know.

Cheers,

Tyler

Here is the processing sketch I am using to test the digitalRead and simply jumping to test the hardware:

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()[1], 57600);
  
  for (int i = 2; i <= 53; i++)
    arduino.pinMode(i, Arduino.INPUT);
}

void draw() {
  background(off);
  stroke(on);
  
  for (int i = 2; i <= 53; i++) {
    if (arduino.digitalRead(i) == Arduino.HIGH)
      fill(on);
    else
      fill(off);
      
    rect(420 - i * 10, 20, 10, 10);
  }
}

My guess is that the problem is in the Arduino.java code

No the problem is with the Standard Firmata software, it has not been extended to cover all the Mega's pins.

That's what I initially thought, but why would the Firmata test program be able to read input's?

Hi

it looks, like I got the same problem. When I work with the Firmata test, I can read from every pin, like 53...

But when I try to read within my own Processing Script, I get no input?

Has there been any solution?

Thank you
n