19 lines
320 B
C++
Executable File
19 lines
320 B
C++
Executable File
|
|
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);
|
|
}
|
|
}
|
|
}
|