19 lines
320 B
Arduino
19 lines
320 B
Arduino
|
|
||
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|