i need send to func a char and number to turn on a.c by heat/cold and temp number
like (heat,28)
and the a.c is turn on heat on 28
i try to get a number and char but is get only the number
help =\
void setup() {
Serial.begin(9600);
}
void loop()
{
AC();
}
void AC()
{
int x;
Serial.println("Type a temp (18-30) into the box above,");
while(true)
{
while (Serial.available() > 0)
{
x = Serial.parseInt();
x = constrain(x, 18, 30);
Serial.print("Setting temp to ");
Serial.println(x);
Serial.print("Input char : ");
char c=Serial.read();
Serial.print("the char is : ");
Serial.println(c);
}
}
}