apuntes_Arduino/serialCom/serial2/serial2.ino
jp.av.dev b6bc7991dc continuacion de reestructuracion
pendientes readmes y
modificar tests/
2022-04-04 02:37:38 -04:00

24 lines
476 B
C++
Executable File

void setup() {
pinMode(3, OUTPUT);
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
int input = Serial.read();
if (input == '1') {
digitalWrite(3, HIGH);
String output = "Encendido @";
output += millis();
output += "ms";
Serial.println(output);
} else {
digitalWrite(3, LOW);
String output = "Apagado @";
output += millis();
output += "ms";
Serial.println(output);
}
}
}