rwkiii wrote:Martinayotte,
Thank you for the code example. I am using GPIO16, GPIO5, GPIO4, and GPIO14 (D0, D1, D2, and D5 respectively).Code: Select allint boardid = (digitalRead(16) << 3) | (digitalRead(5) << 2) | (digitalRead(4) << 1) | digitalRead(14);
Serial.print("Pinned ID: "); Serial.println(boardid);
Connecting all 4 to GND returns a value of 0.
Connecting all 4 to 3.3V returns a value of 15.
Perfect! Thank you.
Well, Welcome !
For Gerardwr suggestion, I though about that too, simply the MAC Addr, but I understand that EndUsers DIP switch is also more convenient (such as RS485 ModBus where there is no MAC involved) ...
martinayotte wrote:For Gerardwr suggestion, I though about that too, simply the MAC Addr, but I understand that EndUsers DIP switch is also more convenient (such as RS485 ModBus where there is no MAC involved) ...
More convenient, yes! But I always try to avoid avoid extra components and soldering, that's why I prefer the software solution.
Nevertheless the dipswitch solution is nice, especially considering the requirement for sequence from 0..31.