I am trying to read an analog signal using the Analog.Read() function and output 1 or 0 depending on the value of the analog signal. While testing using a serial monitor, I always get the symbol for 'phi'instead of 0 and the 'square box with question mark'instead of 1. Please help.
const int analogInPin = A3;
int inputValue=0;
int ch1=1,ch2=0;
void setup()
{
pinMode(A0, INPUT);
Serial.begin(9600);
}
void loop()
{
inputValue = analogRead(analogInPin);
if(inputValue>240)
Serial.print('1');
else
Serial.print('0');
delay(10);
}