Well, I have a half-good news and a bad one:
yes, the .ino file C code works,
but only as long as you do not connect to Node-RED.
void setup()
{
byte pin;
for (pin = 0; pin < TOTAL_PINS-2; pin++) {
digitalWrite(pin, HIGH);
}
So basically if you give it power, if will not turn on anything.
But if I connect to Node-RED, and try to switch 1 PIN "up", =>> ALL pins switch UP too.
It's like the Node is somehow thinks / saves by default, all other pins are HIGH >> and sending ALL those infos with that one order together.
Or maybe the Johnny5 library does.
(I had no time to investigate the JS code, nor J5 C.)
I think a better solution would be to INVERT the LOW / HIGH behaviour completely.
To identify the boards, here is a workaround, if you are willing to sacrafice 3 PINs:
opened 07:52PM - 03 Aug 15 UTC
closed 07:42PM - 25 May 16 UTC
I'm curious if anyone has any insight into this question....
A little backg… round-- I'm working on a project that requires the ability to plug multiple Arduino boards into a powered USB hub, but if an Arduino gets unplugged and plugged back into another port the program needs to still wire the specific logic up to that specific board.. (ad hoc basically) so the logic will need to follow the boards by serial number I presume (which I was able to determine from the "pnpId" through the serialport module by the way.)
So far I have been marginally successful-- however I have hit a few roadblocks and wasn't sure if anyone had discussed this as a possible feature request?
Basically, in a nutshell, I would like to use the Five.Boards(), however I'd like to make sure a specific Arduino (and its connected pins) is always associated with its own "pnpId" serial number, or similar, no matter where the USB bus enumerates its location.
Ideally, what I would really love is to be able to do the following:
Original Code from the J5 API:
var ports = [
{ id: "A", port: "/dev/cu.usbmodem621" }, // <-- This changes if its plugged into another port between execution of the program for instance.
{ id: "B", port: "/dev/cu.usbmodem411" }
];
Note: I get this as the pnpId: (gort scan serial)
"usb-Arduino__www.arduino.cc__0043_8543034323835151B141-if00"
Note: Below I use the following regex to just get the USB FTDI Serial number from that:
---> RegExp '.*_([^-]+)-[a-zA-Z0-9]+$'
What I would like to do (or similar):
var ports = [
{ id: "A", serial: "8543632343135141C0A1" },
{ id: "B", serial: "8543034323835151B141" }
];
...So when I reference the "board" that has an ID of "A" .. I would like be certain that in my database of devices the associated pin will correspond to the correct pins on that specific board.
I'd be happy to share some of the code I currently have in more detail, or if possible, tell me if I am barking up the wrong tree and need to have my head examined.
Thanks in advance!!
But after facing so many problems, I have decided:
I'm dropping Firmata completely.
Not suitable for industrial usage.
(The developer wrote wrote this line himself.)