In using serialprint() function in troubleshooting I have not found what level of redirection is allowed in the argument. It seems that a literal value is needed? number = array[0], serialprint(number) works, but serialprint(array[0]) does not. Does anyone know where to find the documentation of allowed arguments for serialprint() function. The manual is not very explicit on this. I couldn't find anywhere it said an expression that evaluates to a valid data type could not be used.
but serialprint(array[0]) does not.
It would if you used Serial.print(), instead.
If you are having a problem with your code, show it to us. Idle speculation involves beer, which you haven't provided.
but serialprint(array[0]) does not
Strange. It works for me.
byte array[] = {5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5};
void setup()
{
Serial.begin(115200);
for (int i = 0; i < sizeof(array) / sizeof(array[0]); i++)
{
Serial.println(array[i]);
}
}
void loop()
{
}
Does anyone know where to find the documentation of allowed arguments for serialprint() function.
HardwareSerial.cpp on your PC would be a good place to start.