Steren ARD-020 Manual De Instrucciones página 42

Tarjeta programadora compatible con arduino tipo leonardo
Tabla de contenido

Publicidad

Idiomas disponibles

Idiomas disponibles

Program
int ledPin = 13; // choose the PIN for LED
int Nifne = 5; // choose the input pin (for a pushbutton)
int val = 0; // variable for reading the pin status
void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inPin, INPUT); // declare pushbutton as input
}
void loop() {
val= digitalRead (Nifne); // reads input value
if(val== HIGH) { // check if the value read is "1" (button pressed)
digitalWrite(ledPin, LOW); // set the LED to OFF
} else{
digitalWrite(ledPin, LOW); // the LED blinks
delay (200);
digitalWrite (ledPin, HIGH);
delay (200);
}
}
10
10

Publicidad

Tabla de contenido
loading

Tabla de contenido