Page 26 - Proyecto - Ana Guerrero
P. 26

EJERCICIO # 17




               Conectar 6 diodos leds y su función será que en


               cada  columna  encenderán  2  diodos  leds  con  la


               ayuda de un protoboard.























                                    int fim1=2;                digitalWrite(fim3, LOW);
                                    int fim2=3;                digitalWrite(fim4, LOW);
                                    int fim3=4;                digitalWrite(fim6, LOW);
                                    int fim4=5;                        delay(2000);
                                    int fim5=6;                //fila 3 y 4 encendida//
                                    int fim6=7;               digitalWrite(fim3, HIGH);
                                   void setup()               digitalWrite(fim4, HIGH);
                                           {                   digitalWrite(fim1, LOW);
                             pinMode(fim1, OUTPUT);            digitalWrite(fim2, LOW);
                             pinMode(fim2, OUTPUT);            digitalWrite(fim5, LOW);
                             pinMode(fim3, OUTPUT);            digitalWrite(fim6, LOW);
                             pinMode(fim4, OUTPUT);                    delay(2000);
                             pinMode(fim5, OUTPUT);            //Fila 2 encendida y 5//
                             pinMode(fim6, OUTPUT);           digitalWrite(fim2, HIGH);
                                           }                  digitalWrite(fim5, HIGH);
                                    void loop()                digitalWrite(fim1, LOW);
                                           {                   digitalWrite(fim3, LOW);
                            //fila 1 encendida y 6//           digitalWrite(fim4, LOW);
                           digitalWrite(fim1, HIGH);           digitalWrite(fim6, LOW);
                           digitalWrite(fim6, HIGH);                   delay(2000);
                            digitalWrite(fim2, LOW);           //fila 1 encendida y 6//
                            digitalWrite(fim3, LOW);          digitalWrite(fim1, HIGH);
                            digitalWrite(fim4, LOW);          digitalWrite(fim6, HIGH);
                            digitalWrite(fim5, LOW);           digitalWrite(fim2, LOW);
                                    delay(2000);               digitalWrite(fim3, LOW);
                            //Fila 2 encendida y 5//           digitalWrite(fim4, LOW);
                           digitalWrite(fim2, HIGH);           digitalWrite(fim5, LOW);
                           digitalWrite(fim5, HIGH);                   delay(2000);
                            digitalWrite(fim1, LOW);                          }
   21   22   23   24   25   26   27   28   29   30   31