Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
- - Pino 2 do Arduino ligado ao pino 12 do CI.
- - Pino 3 do Arduino ligado ao pino 14 do CI.
- - Pino 4 do Arduino ligado ao pino 11 do CI.
- - Pinos 10 e 16 do CI ligados ao Vcc.
- - Pinos 8 e 13 do CI ligados ao GND.
- ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨*/
- #include <ShiftOutMega.h> //Inclui a bilioteca ShiftOutMega.h
- //Variáveis do CI 74HC595
- int latchPin = 2;
- int dataPin = 3;
- int clockPin = 4;
- int qtdRegistradores = 1; //Quantidade de registradores(74HC595) utilizado no pro jeto.
- ShiftOutMega mega1(latchPin, dataPin, clockPin, qtdRegistradores); //Inicia a biblioteca passando os parametros de uso.
- // ------------------------ Função Acende todos e apaga um a um
- void painel ()
- {
- mega1.shiftWrite(1, HIGH); //Ligando painel verde 1
- mega1.shiftWrite(2, HIGH);
- mega1.shiftWrite(3, HIGH);
- mega1.shiftWrite(4, HIGH);
- mega1.shiftWrite(5, HIGH);
- mega1.shiftWrite(6, HIGH);
- mega1.shiftWrite(7, HIGH);
- mega1.shiftWrite(8, HIGH);
- mega1.shiftWrite(9, HIGH);
- mega1.shiftWrite(10, HIGH);
- delay(1000);
- mega1.shiftWrite(1, LOW); //Desligando painel verde 1
- delay(1000);
- mega1.shiftWrite(2, LOW);
- delay(1000);
- mega1.shiftWrite(3, LOW);
- delay(1000);
- mega1.shiftWrite(4, LOW);
- delay(1000);
- mega1.shiftWrite(5, LOW);
- delay(1000);
- mega1.shiftWrite(6, LOW);
- delay(1000);
- mega1.shiftWrite(7, LOW);
- delay(1000);
- mega1.shiftWrite(8, LOW);
- delay(1000);
- mega1.shiftWrite(9, LOW);
- delay(1000);
- mega1.shiftWrite(10, LOW);
- delay(1000);
- }
- //------------------------------------------------
- void setup()
- {
- }
- //------------------------------------------------
- void loop()
- {
- painel ();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement