int i = 0;
bool test = true;
int pmc = 0;
void setup() {
// 0xaa / 55
DDRD = 255;
pinMode(13, INPUT_PULLUP);
}
void loop() {
PORTD = 0;
if(digitalRead(13) == LOW && test == true)
{
test = false;
PORTD = PORTD | 1<<i;
if(i < 7)
{
i++;
}
else
{
i = 0;
PORTD = 0;
}
}
else if (digitalRead(13) != LOW && test != true)
{
test = true;
}
}