Hello, everyone! I would like to ask for help regarding on how to convert ascii to int.
I am using xbee s1 to communicate 2 arduinos. On my transmitter side, i am sending values like 143, 256, 453.. On my receiver side. I am receiving the same readings using this code
if (XBee.available())
{ // If data comes in from XBee, send it out to serial monitor
Serial.write(XBee.read());
}
I would like to use these readings to latch my relay but i think that it is not possible without converting it to int.
I would like to satisfy this code:
if (sensorvalue <= 150 )
{
digitalWrite(relay, LOW);
}
else
{
digitalWrite(relay, HIGH);
}
Thanks in advance!