forlotto wrote:I wonder if this was an intentional change in the map or something else?
I wouldn't know.
I'd suggest this code like this instead of the current LookUpNodeMCUPins function:
Code: Select allbyte LookUpNodeMCUPins(String Name)
{
byte nodemcuPins[8] = { 16,5,4,0,2,14,12,13,15 };
if (Name.charAt(0) == F("D"))
{
PinReturnValue = nodemcuPins[Name.charAt(1)-48];
}
else
{
if (Name == F("RX")) PinReturnValue = 3;
if (Name == F("TX")) PinReturnValue = 1;
}
return PinReturnValue;
}
I think this would take less code space and execute faster. Just not sure where nodemcuPins should be declared. Also, I suspect that the code calling this function may already test that first character and it might be faster to fold this function back into the calling routine. I can't tell because I haven't figured out where to find the rest of the code.