Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int pinLatch = 2;
- const int pinReloj = 3;
- const int pinDato = 4;
- int led[pines] = {2,3,4};
- int valor=0;
- int i=0;
- void setup ()
- {
- Serial.begin(9600);
- for (int i=0;i<pines;i++)
- pinMode(led[i],OUTPUT);
- }
- void loop()
- {
- if(Serial.available() > 0)
- {
- valor = Serial.read();
- activacion(valor);
- }
- }
- void activacion(int i)
- {
- digitalWrite (pinLatch, LOW);
- shiftOut (pinDato, pinReloj, MSBFIRST, valor);
- digitalWrite (pinLatch, HIGH);
- delay(50);
- }
Advertisement
Add Comment
Please, Sign In to add comment