apuntes_Arduino/serialCom/serial1/serial1.ino

19 lines
320 B
Arduino
Raw Normal View History

2021-01-05 00:15:16 -03:00
void setup() {
pinMode(2, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
int input = Serial.read();
Serial.print("Valor Recibido : ");
Serial.println(input);
if (input == '1') {
digitalWrite(2, HIGH);
} else {
digitalWrite(2, LOW);
}
}
}