24 lines
476 B
Arduino
24 lines
476 B
Arduino
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|