hello, I want to paint with a led full circle.
begins with a painted like a pacman, remains open, then start
to increase the speed, and this opening begins to close,
but when this opening tends to SHUT, a turn off.
that is passed, any ideas? as you sack this effect, shutting
around when the circle is closed?
volatile unsigned long timeold=0;
volatile unsigned long new_time = 0;
volatile unsigned long refreshEnd = 0;
volatile unsigned long Refresh = 0;
void setup(){
pinMode(13, OUTPUT); //led
attachInterrupt(0, rpm, FALLING);
}
void rpm(){
new_time=micros();
Refresh = (new_time - timeold) ;
timeold = new_time;
interruptHit =true;
}
void loop() {
if( interruptHit ==true){
// time delay Pacman
refreshEnd=micros();
while( (micros() - refreshEnd)< 200 ) {;}
//
digitalWrite(13, HIGH); // set the LED on
//time paint full circulo
refreshEnd=micros();
while( (micros() - refreshEnd)< Refresh ) {;}
interruptHit =false;
}else{
digitalWrite(13, LOW); // set the LED on
}
}