int datapin = 6;
int latchpin = 3;
int clockpin = 5;
byte myled = 0b00000001;
void setup() {
// put your setup code here, to run once:
pinMode(datapin, OUTPUT);
pinMode(latchpin, OUTPUT);
pinMode(clockpin, OUTPUT);
Serial.begin(115200);
}
void loop() {
led();
delay (10);
led1();
delay(50);
}
void led(){
// put your main code here, to run repeatedly:
digitalWrite(latchpin, LOW);
shiftOut(datapin,clockpin,LSBFIRST,myled);
digitalWrite(latchpin, HIGH);
delay(50);
myled = myled/128+myled*2;
Serial.println(myled,BIN);
}
void led1(){
digitalWrite( latchpin, LOW);
shiftOut( datapin,clockpin,MSBFIRST,myled );
digitalWrite ( latchpin,HIGH);
}