I have a code in which you can have a "conversation" with your arduino. I am in the process of typing it and when I checked if what I typed so far made sense there were a few errors I was just wondering if you can help me.
HelloArduino.ino: In function 'void loop()':
HelloArduino:30: error: no matching function for call to 'HardwareSerial::read(int)'
/Users/sharma/Desktop/ .app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.h:60: note: candidates are: virtual int HardwareSerial::read()
HelloArduino:32: error: expected unqualified-id before '}' token
HelloArduino:32: error: expected `;' before '}' token
Serial.read() returns a character, it doesn't return true/false, so you don't pass it a value to check it against, you check if the return value equals a constant.
void loop() {
if (Serial.read(49)) {
Serial.print("");
}
}
The errors are:
~~~
HelloArduino.ino: In function 'void loop()':
HelloArduino:30: error: no matching function for call to 'HardwareSerial::read(int)'
/Users/sharma/Desktop/ .app/Contents/Resources/Java/hardware/arduino/cores/arduino/HardwareSerial.h:60: note: candidates are: virtual int HardwareSerial::read()
HelloArduino:32: error: expected unqualified-id before '}' token
HelloArduino:32: error: expected `;' before '}' token