bool rechts = LOW;
void setup() {
// put your setup code here, to run once:
DDRD=B11111111;
PORTD=B00000001;
}
void loop() {
// put your main code here, to run repeatedly:
delay(500);
if(PORTD==B10000000){
rechts = HIGH;
}
if(PORTD==B00000001){
rechts = LOW;
}
if(rechts){
PORTD=PORTD >> 1;
}
if(rechts==LOW){
PORTD=PORTD << 1;
}
}