/*
This program was written in the simplest possible way in order to prevent
a not excellent knowledge of programming language. It is possible use it
HOW IT IS only on the wokwi simulator
For no reason the use of this code make the authors responsible and
even less obliges them to provide support and / or any explanation or
clarification
However, if possible, we will try to answer to any questions,
without any obligation and / or commitment and / or responsibility
by https://www.facebook.com/groups/883620498953478 TEAM
The user of this software will have total, complete
and exclusive responsibility for anythings.
Anyone can modify it and adapt it to own needs,always reporting the
present declaration, even after important changes.
These phrases will always reported in complete form, without this declaration
there will be a copyright violation
Thank you
*/
void setup() {
pinMode(12,OUTPUT);
pinMode(11,OUTPUT);
pinMode(10,OUTPUT);
pinMode( 9,OUTPUT);
// TIMER1 setup
// reset
TCCR1A = 0;
TCCR1B = 0;
TIMSK1 |= B00000001; // ISR TIMER1_OVF ON
TCCR1B |= (1 << CS11)|(1 << CS10); // set prescaler & start counter
}
volatile int i=-100;
ISR(TIMER1_OVF_vect)
{ i+=100;
TCNT1=55000; // set restart value counter
}
void loop()
{ switch(i)
{ case 0: PORTB=0b00100000; break;
case 1000: PORTB=0b00010000; break;
case 2000: PORTB=0b00001000; break;
case 3000: PORTB=0b00000100; break;
case 4000: PORTB=0b00000010; break;
case 5000: PORTB=0b00000001; break;
case 6000: PORTB=0b00100001; break;
case 7000: PORTB=0b00010010; break;
case 8000: PORTB=0b00001100; break;
case 9000: PORTB=0b00010010; break;
case 10000: PORTB=0b00100001; break;
case 11000: i=-100; break;
default: break;
}
}