# data[].attributes.headline
Encender y apagar un LED con dos pulsadores

# data[].attributes.subject
Encender y apagar un LED con dos pulsadores

# data[].attributes.body
int ledPin = 5;
int inputPin1 = 2; // pulsador 1
int inputPin2 = 3; // pulsador 2
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(inputPin1, INPUT);
pinMode(inputPin2, INPUT);
}

void loop() {
if (digitalRead(inputPin1) == HIGH) {
digitalWrite(ledPin, HIGH);
}
else if (digitalRead(inputPin2) == HIGH) {
digitalWrite(ledPin, LOW);
}
}

# data[].attributes.body
void setup() {
// put your setup code here, to run once:

}

void loop() {
pinMode(8, OUTPUT);
digitalWrite(8, LOW);
delay(1000);
digitalWrite(8, HIGH);
delay(1000);
}

# data[].attributes.body
void setup() {
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(8, OUTPUT);

}

void loop() {

delay(200);
digitalWrite(13, LOW);
digitalWrite(12, HIGH);
delay(200);
digitalWrite(12, LOW);
digitalWrite(8, HIGH);
delay(200);
digitalWrite(8,LOW);
digitalWrite(12, HIGH);
delay(200);
digitalWrite(12, LOW);
digitalWrite(13, HIGH);

}

# data[].attributes.headline
Encender y apagar dos LEDs con un pulsador

# data[].attributes.subject
Encender y apagar dos LEDs con un pulsador

# data[].attributes.body
const int LED=13;
const int BOTON=7;
int val;
void setup() {
pinMode(LED,OUTPUT);
pinMode(BOTON,INPUT);
}

void loop() {
val=digitalRead(BOTON);
if  (val==HIGH){
digitalWrite(LED,HIGH);
}
else { digitalWrite(LED,LOW);
}
}

# data[].attributes.body
void setup()

{

pinMode(1, OUTPUT);

pinMode(2, OUTPUT);

pinMode(3, OUTPUT);

pinMode(4, OUTPUT);

pinMode(5, OUTPUT);

pinMode(6, OUTPUT);

pinMode(7, OUTPUT);

pinMode(8, OUTPUT);

pinMode(9, OUTPUT);

pinMode(10, OUTPUT);

pinMode(11, OUTPUT);

pinMode(12, OUTPUT);

pinMode(13, OUTPUT);

}

void loop() {

digitalWrite(13, HIGH);

digitalWrite(12, HIGH);

digitalWrite(11, HIGH);

digitalWrite(10, HIGH);

digitalWrite(9, HIGH);

delay(1000);

// 1

digitalWrite(11, HIGH);

digitalWrite(8, HIGH);

digitalWrite(6, HIGH);

digitalWrite(7, HIGH);

digitalWrite(5, HIGH);

digitalWrite(10, LOW);

digitalWrite(2, HIGH);

digitalWrite(1, HIGH);

digitalWrite(4, HIGH);

//2

delay(1000);

digitalWrite(12, LOW);

digitalWrite(4, HIGH);

digitalWrite(1, HIGH);

digitalWrite(3, HIGH);

delay(1000);

//3

digitalWrite(11, HIGH);

digitalWrite(8, LOW);

digitalWrite(7, LOW);

digitalWrite(13, LOW);

digitalWrite(10, HIGH);

digitalWrite(1, HIGH);

digitalWrite(1, HIGH);

digitalWrite(1, HIGH);

digitalWrite(1, HIGH);

delay(1000);

//4

digitalWrite(5,LOW);

digitalWrite(13, HIGH);

digitalWrite(7, HIGH);

digitalWrite(6, HIGH);

digitalWrite(9, HIGH);

digitalWrite(8, HIGH);

digitalWrite(4, HIGH);

digitalWrite(1, HIGH);

digitalWrite(1, HIGH);

digitalWrite(1, HIGH);

digitalWrite(1, HIGH);

delay(1000);

//5

digitalWrite(5,LOW);

digitalWrite(13, HIGH);

digitalWrite(7, HIGH);

digitalWrite(6, HIGH);

digitalWrite(9, HIGH);

digitalWrite(8, HIGH);

digitalWrite(4, HIGH);

digitalWrite(1, HIGH);

digitalWrite(12, HIGH);

delay(1000);

//6

digitalWrite(13, LOW);

digitalWrite(12, LOW);

digitalWrite(11, LOW);

digitalWrite(10, LOW);

digitalWrite(1, LOW);

digitalWrite(7, LOW);

digitalWrite(6, HIGH);

digitalWrite(5, HIGH);

delay(1000);

//7

digitalWrite(1, HIGH);

digitalWrite(2, HIGH);

digitalWrite(3, HIGH);

digitalWrite(4, HIGH);

digitalWrite(5, HIGH);

digitalWrite(6, HIGH);

digitalWrite(7, HIGH);

digitalWrite(8, HIGH);

digitalWrite(9, HIGH);

digitalWrite(11, HIGH);

digitalWrite(12, HIGH);

digitalWrite(13, HIGH);

digitalWrite(10, HIGH);

delay(1000);

//8

digitalWrite(12, LOW);

delay(1000);

//9

}

# data[].attributes.headline
Encender y apagar un LED con un pulsador

# data[].attributes.subject
Encender y apagar un LED con un pulsador

# data[].attributes.body
const int LED=13;
const int BOTON=7;
int val;
void setup() {
pinMode(LED,OUTPUT);
pinMode(BOTON,INPUT);
}

void loop() {
val=digitalRead(BOTON);
if  (val==HIGH){
digitalWrite(LED,HIGH);
}
else { digitalWrite(LED,LOW);
}
}

# data[].attributes.body
void setup() {
// put your setup code here, to run once:

}

void loop() {
pinMode(8, OUTPUT);
pinMode(7,OUTPUT);
delay(1000);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
delay(1000);
digitalWrite(8, HIGH);
digitalWrite(7, LOW);
}

# data[].attributes.body
int a=0;
void setup(){
pinMode(7 , INPUT);
pinMode(4, OUTPUT);
}

void loop(){
a=digitalRead(7);
if (a==HIGH){
digitalWrite(4, LOW);
}
else {
digitalWrite(4, HIGH);

}
}

# data[].attributes.headline
Regular la intensidad de un LED con un potenciometro

# data[].attributes.subject
Regular la intensidad de un LED con un potenciometro

# data[].attributes.body
const int led =3;
const int pot =0;

int brillo;

void setup ()  {
  pinMode (led, OUTPUT);
}

void loop (){
  brillo = analogRead (pot) / 4;
  analogWrite(led, brillo);
}