byte h = 0, m = 0, s = 0;
byte BUFFER = 255;
byte index = 0;
String inString;
bool isEndMessage = false;
void setup() {
Serial.begin(9600);
Serial.println("Write Hour!");
while (!Serial.available())
delay(1);
h = atoi(GetData());
Serial.println("Write Min!");
while (!Serial.available())
delay(1);
m = atoi(GetData());
}
String GetData() {
inString = "";
isEndMessage = false;
while (Serial.available()) {
char ch = Serial.read();
switch (ch) {
case '\n':
case '\r':
isEndMessage = true;
break;
}
if (!isEndMessage)
inString += Serial.read();
delay(1);
}
return inString;
}
byte atoi(String data) {
byte result = 0;
//дописываем логику
return result;
}