Files
hpos-web/firmware/hemocube_mock/hemocube_mock.ino

46 lines
1.7 KiB
Arduino
Raw Normal View History

2023-08-04 23:50:47 +05:30
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
2023-08-04 23:57:32 +05:30
2023-08-05 00:22:39 +05:30
Serial.println("SN:182829");
2023-08-06 14:01:52 +05:30
// while (Serial.available() == 0) {} //wait for data available
// String bufferCommand = Serial.readString(); //read until timeout
// bufferCommand.trim(); // remove any \r \n whitespace at the end of the String
// if (bufferCommand == "B") {
// Serial.println("#Start Buffer");
// delay(2000);
// Serial.println("#Buffer Completed");
// }
2023-08-05 00:22:39 +05:30
2023-08-06 14:01:52 +05:30
// while (Serial.available() == 0) {} //wait for data available
// String SampleCommand = Serial.readString(); //read until timeout
// SampleCommand.trim(); // remove any \r \n whitespace at the end of the String
// if (SampleCommand == "S") {
// Serial.println("#Sample Started");
// delay(2000);
// 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);
// }
2023-08-05 00:22:39 +05:30
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
2023-08-06 14:01:52 +05:30
if (resultCommand == "B") {
2023-08-05 00:22:39 +05:30
delay(3000);
2023-08-06 14:01:52 +05:30
Serial.println("ERROR 500 REND");
2023-08-05 00:22:39 +05:30
delay(15000);
}
2023-08-04 23:50:47 +05:30
}