Hi
Im a newbie to c++ programing. I write program that send some character to arduino and it will be displayed on LCD.
I want if "cls" string was send to board the LCD become clear. But I get error.
This is the Code:
char (incomingByte) = 0; // for incoming serial data
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
lcd.begin(16, 2) ;
}void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte) ;
lcd.print (incomingByte);
if ( incomingByte == "cls") lcd.clear ;}
}
What changes are needed?
sorry for my bad english