I am reading the docs on DigitalRead() and wondering why it stores seemingly boolean
LOW inputs in
int data type variable.
I have two issues with that:
intis 2-byte, while
uint8_tare 1-byte so it seems like a waste of memory for no benefit whatsoever.
- It gets me confused when reading the code about whether the input came from digital or analog since
intcan have a wide range.
Is there any particular reason for storing digital inputs as
uint8_t are out of the question as per the answer below.
int8_t still looks suitable for the purpose though.