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
http://www.arduino.cc/playground/Interfacing/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);
}
}