Go Down

Topic: Firmata to access 20 Leonardo Pins (Read 538 times) previous topic - next topic

eightlines

First, my setup. I've set up a circuit which uses 20 pins on an Arduino Leonardo. 10 analog (A0, A1, A2, A3, A4, A5, D12, D10, D9, D8), 10 digital (D0, D1, D2, D3, D4, D5, D6, D7, D11, D13). I've upgraded Firmata to version 2.3.2 to access the new analog pins. I can successfully hit all the pins from Firmata (via openFrameworks) except pin D1. Within the Arduino IDE I can hit every pin successfully.

A question about Firmata. Should I avoid using the TX/RX pins entirely? If I activate the pin D1, D0 activates and D1 does not. At first I thought it may be a circuit issue, but the Arduino script can set the D1 to HIGH without affecting D0. This leads me to suspect it's an issue with the way I'm accessing it through Firmata.

I've also tried attaching to the digital pins in the ICSP header D14, D15, D16, D17, without luck.

I'm hoping someone has some insight to point me in the right direction. Thanks.

PaulS

Quote
Should I avoid using the TX/RX pins entirely?

How is Firmata communicating with the PC? On other boards, it is using Serial.read() and Serial.print(), which use the hardware serial port's pins. I don't know it that is the case with the Leonardo.

Quote
If I activate the pin D1, D0 activates and D1 does not.

Look at the HardwareSerial.h and HardwareSerial.cpp files for a clue.


eightlines

I'm a little fuzzy on how Firmate uses the TX/RX pins, but I don't see any Serial calls being made.

I've ended up moving the TX pin to the ICSP MOSI pin and referencing D16 which seems to work. Leaving the pin on D0 probably isn't ideal but it seems to work.

It may be possible to use the keyboard emulation on the pins if I had buttons on the digital pins. (Right now I have pressure sensors on the analog pins.)

PaulS

Quote
I'm a little fuzzy on how Firmate uses the TX/RX pins, but I don't see any Serial calls being made.

You don't see any Serial calls where? In the Firmata sketch? Probably because they are being made in the Firmata library.

Go Up