I'm not sure if I'm totally up to date here but with a nano on Windos10 I also get no pin 7 reported. ARDUINO_INFO: version 2 5 ARDUINO_INFO: firmware StandardFirmata.ino 2 5
A pin like D2 willl report: comport receives from the arduino: 144 120 1 (b01111000) (b00000001) convert_to_symbolic_commands outputs: digital 2 0 ARDUINO_OUT: digital 2 0 comport receives from the arduino: 144 124 10 (b01111100) (b00000001) convert_to_symbolic_commands outputs: digital 2 1 ARDUINO_OUT: digital 2 1 But piin 7 is like this: comport receives from the arduino: 144 124 0 (b01111100) (b00000000) comport receives from the arduino: 144 124 1 (b01111100) (b00000001) This appears to be because the state of pin 7 is in the second data byte, which is ignored by the [pd convert_to_symbolic_commands ]. Bits 8 and up work because they are in the next port, so they appear as bits 0-7, so probably Pin 15 also doesn't work. The code in firmatamarshaller.cpp refers to two versions: FirmataStream->write(DIGITAL_MESSAGE | (portNumber & 0xF)); // Tx bits 0-6 (protocol v1 and higher) // Tx bits 7-13 (bit 7 only for protocol v2 and higher) encodeByteStream(sizeof(portData), reinterpret_cast<uint8_t *>(&portData), sizeof(portData)); . ...so possibly pduino is not yet compatible with version2. Martin On Sat, Mar 20, 2021 at 6:15 PM Roman Haefeli <[email protected]> wrote: > > On Sat, 2021-03-20 at 21:53 +0100, Roman Haefeli wrote: > > On Sat, 2021-03-20 at 19:24 +0100, Gilles Marivier wrote: > > > : > > > > https://github.com/pd-externals/pduino/issues > > > > > > Done ! > > > > > > I forgot a point : all others pins work fine on Nano > > > > Thanks, yeah, I saw it. However, I can't make any promises, though, > > since I don't own a Nano (in case that problem is specific to the > > Nano, > > which is not yet clear). > > Ok, this particular problem is fixed in current master. It turns out > the buggy code had 8 copies! So always the last pin in a group of 8 (7, > 15, 23, etc.) did not return anything. > > I believe this digital input mess could be done in a better, more > robust way with less code duplication. > > Also, with the Arduino Leonardo and Firmata 2.5, the higher numbered > pins (the "analog pins") do not report with pduino when set as digital > inputs. > > It looks like some refactoring of that old code is warranted. > > Roman > _______________________________________________ > [email protected] mailing list > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list _______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
