This commit is contained in:
Pritimay Sarkar
2023-08-17 21:42:04 +05:30
parent 82c90abf80
commit b86db17e88

View File

@@ -7,39 +7,39 @@ void loop() {
// put your main code here, to run repeatedly: // put your main code here, to run repeatedly:
Serial.println("SN:182829"); Serial.println("SN:182829");
// while (Serial.available() == 0) {} //wait for data available while (Serial.available() == 0) {} //wait for data available
// String bufferCommand = Serial.readString(); //read until timeout String bufferCommand = Serial.readString(); //read until timeout
// bufferCommand.trim(); // remove any \r \n whitespace at the end of the String bufferCommand.trim(); // remove any \r \n whitespace at the end of the String
// if (bufferCommand == "B") { if (bufferCommand == "B") {
// Serial.println("#Start Buffer"); Serial.println("#Start Buffer");
// delay(2000); delay(2000);
// Serial.println("#Buffer Completed"); Serial.println("#Buffer Completed");
// } }
// while (Serial.available() == 0) {} //wait for data available while (Serial.available() == 0) {} //wait for data available
// String SampleCommand = Serial.readString(); //read until timeout String SampleCommand = Serial.readString(); //read until timeout
// SampleCommand.trim(); // remove any \r \n whitespace at the end of the String SampleCommand.trim(); // remove any \r \n whitespace at the end of the String
// if (SampleCommand == "S") { if (SampleCommand == "S") {
// Serial.println("#Sample Started"); Serial.println("#Sample Started");
// delay(2000); delay(2000);
// Serial.println("#Sample Completed"); Serial.println("#Sample Completed");
// } }
// while (Serial.available() == 0) {} //wait for data available
// String resultCommand = Serial.readString(); //read until timeout
// resultCommand.trim(); // remove any \r \n whitespace at the end of the String
// if (resultCommand == "R") {
// delay(3000);
// Serial.println("RESULT SN 18291 1937.23 2828.11 28211.20 121829.12 REND");
// delay(15000);
// }
while (Serial.available() == 0) {} //wait for data available while (Serial.available() == 0) {} //wait for data available
String resultCommand = Serial.readString(); //read until timeout String resultCommand = Serial.readString(); //read until timeout
resultCommand.trim(); // remove any \r \n whitespace at the end of the String resultCommand.trim(); // remove any \r \n whitespace at the end of the String
if (resultCommand == "B") { if (resultCommand == "P") {
delay(3000); delay(3000);
Serial.println("ERROR 500 REND"); Serial.println("RESULT SN 18291 1937.23 2828.11 28211.20 121829.12 REND");
delay(15000); delay(15000);
} }
// while (Serial.available() == 0) {} //wait for data available
// String resultCommand = Serial.readString(); //read until timeout
// resultCommand.trim(); // remove any \r \n whitespace at the end of the String
// if (resultCommand == "B") {
// delay(3000);
// Serial.println("ERROR 500 REND");
// delay(15000);
// }
} }