0% found this document useful (0 votes)
165 views1 page

RCK 54

This code defines variables for data, clock, and latch pins and sets their modes to output. It uses a for loop to light different LED patterns by shifting binary values out to the pins.

Uploaded by

api-270759082
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
165 views1 page

RCK 54

This code defines variables for data, clock, and latch pins and sets their modes to output. It uses a for loop to light different LED patterns by shifting binary values out to the pins.

Uploaded by

api-270759082
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 1

int data = 2;

int clock = 3;
int latch = 4;
int dada = 0;
int ledState = 0;
const int ON = HIGH;
const int OFF = LOW;
void setup() {
pinMode(data, OUTPUT);
pinMode(clock, OUTPUT);
pinMode(latch, OUTPUT);
}
void loop() {
int delaytime = 150;
for(int a = 0; a < 9; a++) {
int valor = 1;
for ( int i = 0; i < a ; i++) {
valor= valor * 2;
}
updateLEDs(valor - );
delay(delaytime);
}
}
void updateLEDs(int value){
digitalWrite(latch, LOW);
shiftOut(data, clock, MSBFIRST, value);
digitalWrite(latch, HIGH);
}

You might also like