Arduino: How do I convert a decimal to ASCII? Answered
I'm following this Instructable which is about communicating between 2 Arduinos with RF modules. The received value is stored in buff and if this value is "1", a light switches on. However, I was going to experiment with sending values other that 1 or 0 from the other Arduino and first added Serial.println(but) but in the serial monitor, it read 49, which if you treat as a decimal value and convert ASCII, you get "1". Equally, when "0" was sent from the sending Arduino, the monitor read 48, which is decimal of the ASCII value "1".
I'm a bit confused as the if-statement below works fine.
Basically, I want "1" and "0" to be printed to the serial monitor not 48 and 49. How do I do this?
//some code here...