bool v byte

The C++ STL has a specialization for std::vector that allows storing each element as a single bit. Whether this actually happens or not is implementation defined.

https://en.cppreference.com/w/cpp/container/vector_bool

In Arduino Platform, the keyword bool allocates 1-byte space for the bool type variable. The 1-byte space may hold any number from -128 to 127 considering binary representation in 2's complement form.

In Arduino programming, we traditionally declare the flags as:

bool flag1 = true;
bool flag2 = false:

However, we usually don't do the following though there is no harm to do so:

byte flag1 = true;
byte flag2 = false;

What numerical value does the compiler assign for the symbolic names true and false? For true, the assigned number is 00000001 (1) and for false, it is 00000000 (0).

PaulS:
When I see a bool variable, [...] you can assign a bool value any value between 0 and 255

No, you can't. I tried. The compiler forces it to 0/false or 1/true.
Even if you use a union to put them both in the same memory loction, if you write or read the bool it will write or read 0 or 1. Only if you writ and read the byte can you get a value other than 0 or 1:

union boolbyte {
  bool boolVal;
  byte byteVal;
} value;


void setup()
{
  Serial.begin(115200);


  value.boolVal = 255;
  Serial.println(value.boolVal);  // displays 1
  Serial.println(value.byteVal);  // displays 1


  value.byteVal = 255;
  Serial.println(value.boolVal);  // displays 1
  Serial.println(value.byteVal);  // displays 255
}


void loop() {}

keep in mind that bool AND byte will take up the same amount of memory (to the best of my knowledge) in Arduino.

you can also get TRUEs and FALSEs using byte as well.

I do think that the will be compiling issues when substituting one for the other in environments other than Arduino.

I don't like using true and false to mean anything other than true and false, because the code is not self-documenting. Even if I have only 2 values, I find it much clearer to enumerate the values. This doesn't affect the compiled code and really helps with organizing the code.

enum thingState : char {Auto, Manual};
thingState thingSwitch;

void setup() {
}

void loop() {
  thing();
}

void thing() {
  switch (thingSwitch) {
    case Auto: {
      // do stuff autonomously and take over the world!
      break;
      }
    case Manual: {
      // poll manual inputs and react
      break;
      }
  }
}