Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
void setup() {
Serial.begin(115200);
pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
delay(10000);
Serial.println("GLITCH RDY");
}
int glitchCtr = 0;
int secCtr = 1;
void loop() {
// put your main code here, to run repeatedly:
if(glitchCtr > 2000000)
{
Serial.print("DUMPING POWER FOR ");
Serial.println(secCtr);
digitalWrite(13,LOW);
// try to pass time.
int waste = 0;
for(int i = 0;i < secCtr;i++)
{
waste++;
}
secCtr *= 2;
digitalWrite(13,HIGH);
glitchCtr = 0;
}
else
{
glitchCtr++;
digitalWrite(13,HIGH);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment