[Arduino]
The function below generates a warning "warning: variable 'OK' set but not used ". It is only a warning but I would like to understand why, and to eliminate the warning if possible.
Unused variable when it is used as the return value [Solved]
The function below generates a warning "warning: variable 'OK' set but not used ". It is only a warning but I would like to understand why, and to eliminate the warning if possible.
Code:
bool HC12SetBaud(enum HC12Baud Baud)
{
uint16_t BaudRate;
char BaudCommand[11];
bool OK = false;
switch(Baud)
{
case Baud1200:
BaudRate = 1200;
break;
case Baud2400:
BaudRate = 2400;
break;
case Baud4800:
BaudRate = 4800;
break...