Here is my explanation of what i want to accomplish: i have 8 L.E.Ds set up using a shift register, i have a byte shifting like this 0b00001000, 0b00010000, 0b00100000, 0b01000000, 0b10000000, 0b0000001. as you have noticed it restarted at 0b0000001 i want it to restart at this 0b00001000. then after i figure out how to make it restart at the byte i want it too then i will have another byte starting at: 0b00010000 then going 0b0001000, 0b00000100...ect, then restarting at 0b00010000. so essentially the middle 2 L.E.Ds will be lit, then the middle 2 off, then one will travel left and the other right. so on so on until both L.E.Ds met back up at the middle!
const int DS_pin = 8; // this is the pin that sends the data!
const int STCP_pin = 9; //latch pin: data is coming in when set to low, after set to high.
const int SHCP_pin = 10; //shift register clock: sync's data when latch is low.
int delayPeriod = 500;
byte led1 = 0b00001000;
byte led2 = 0b00010000;
void setup(){
Serial.begin(9600);
pinMode(DS_pin, OUTPUT);
pinMode(STCP_pin, OUTPUT);
pinMode(SHCP_pin, OUTPUT);
}
void loop(){
digitalWrite(STCP_pin, LOW);
shiftOut(DS_pin, SHCP_pin, LSBFIRST, led1);
digitalWrite(STCP_pin, HIGH);
Serial.println(led1, BIN);
delay(delayPeriod);
led1 = led1 * 128 + led1 / 2;
/*digitalWrite(STCP_pin, LOW);
shiftOut(DS_pin, SHCP_pin, LSBFIRST, led2);
digitalWrite(STCP_pin, HIGH);
Serial.println(led2, BIN);
delay(delayPeriod);
led2 = led2 / 128 + led2 * 2;*/
}
74HC595