Ejemplo tres_2 para Arduino
char inChar;
String string="";
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
inChar=Serial.read();
string.reserve(200);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()){
//string+=inChar;
//Serial.print(string);
if(inChar=='*'){
Serial.print("Lectura: ");
Serial.print(inChar);
//string="";
n=Serial.parseInt();
if(inChar=='*' &&& n=123){
}
}
}
}
String string="";
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
inChar=Serial.read();
string.reserve(200);
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()){
//string+=inChar;
//Serial.print(string);
if(inChar=='*'){
Serial.print("Lectura: ");
Serial.print(inChar);
//string="";
n=Serial.parseInt();
if(inChar=='*' &&& n=123){
}
}
}
}
Comentarios
Publicar un comentario