Two newbie questions: status and printing a boolean

ViennaMike:

  1. When I went to name a variable "status" the IDE flags it as a reserved word, but I can't find any reference to such a reserved word. What is "status" used for?

Could be a library that you have installed. Could be a holdover from Wiring. It is probably a method to a class, so using it as a variable probably doesn't matter. The IDE isn't very sophisticated about highlighting. All keywords are stored in a file called "keywords.txt". Each library comes with its own keywords.txt file.

ViennaMike:
boolean state = false;

Then I tried to print it with Serial.println(state); but nothing comes out of the serial monitor.

The reference page says Serial.print and println can take any variable type as an argument. If you look at the source code, there is no definition for the boolean type.

When I have booleans, I find it kind of useless to just get a "true" or "false" response. To get anything useful, you'd need to do a Serial.print() before printing the value anyway. So instead I do this:

if (state)
  Serial.println("Connected!");
else
  Serial.println("Failed!");