5

I got an Arduino Mega 1280 and want to communicate with it via Firmata. That sounds easy...

So my problem: If I use the StandardFirmata Firmware for the Arduino, which is included in Arduino 1.0, I can set output Pins, and send a signal to them ((highlighting a led on pin 24):

arduino.digitalWrite(24, Arduino.HIGH);

But I cannot read any digital input from my Mega. As I found out, some people had the problem with reading on ports higher than 13. I can't verify it, my input signals start at port 23. example:

if (arduino.digitalRead(25) == Arduino.HIGH){
  println("is high");
  }

Now I installed the AllInputsFirmata on my Mega, it is also preinstalled in Arduino 1.0. Now it is no problem to read from an digital input: example:

if (arduino.digitalRead(25) == Arduino.HIGH){
  println("is high");
  }

But this time, I can't send any signal out.

So, what is going on?

(Yes, I tested it with the FirmataTest software, and there everything goes alright!)

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107
nbuechi
  • 229
  • 4
  • 20
  • Have you tried with different versions of the Arduino Software? Perhaps 0022 or 0023? – gotnull Feb 15 '12 at 22:53
  • are you using the [mega specific library](http://arduino.cc/playground/uploads/Nilseuropa/processing-arduinomega.zip) from the [Arduino Playground](http://www.arduino.cc/playground/Interfacing/Processing)? – JAMESSTONEco Oct 06 '12 at 19:15

1 Answers1

0

not sure but in Arduino c++ first you need to set the mode of the pin, before you can send data out. There digital read works also better when setting the mode first. Might the same apply here ?

If so this might be of help for you http://arduino.cc/en/Reference/Firmata

user613326
  • 2,140
  • 9
  • 34
  • 63