-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Hello,
I am trying to read 2 lines sent from the arduino my code is below. I am trying to create a function when the word ABLINK is received it prints out something....same with when ABO is read. Only the first IF statement works. How can I make the second one work? I am stumped. Thanks for the help!
if(n == 39) {
Serial.println("ABLINK");
for(int i = 0; i < 10; i++) {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(150);
}
delay(1000);
Serial.println("ABO");
}And my Java code is below:
String line = arduino.serialRead('6');
if(line.contains("ABLINK")) {
System.out.println("ALL LEDS BLINKING");
} else {
AnsiConsole.systemInstall();
System.out.println("ERROR!!");
}
String line2 = arduino.serialRead('4');
if(line2.contains("ABO")) {
System.out.println("ALL LEDS BLINKING OFF");
} else {
System.out.println("ERROR!! line="+ line +"<");
} Metadata
Metadata
Assignees
Labels
No labels