Lab_interaccio/2012/Edgard/test_serial/test_serial.ino

25 lines
457 B
Arduino
Raw Permalink Normal View History

2025-02-25 21:29:42 +01:00
String temp_String = "";
void serial_str() {
if(Serial.available()>0)
{
char inByte;
inByte = Serial.read();
if (inByte!='/') temp_String = temp_String + inByte;
else {Serial.println(temp_String); temp_String = "";}
/*if ((model[model_count]==inByte[0])&&(model_count<5)) model_count++;
else num_model = atoi(inByte);*/
}
}
void setup() {
Serial.begin(9600);
}
void loop() {
serial_str();
}