Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
int led1 = 2;
int led2 = 3;
void setup() {
Serial.begin(115200);
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
for(int i = 0;i < 3; i++)
{
flashGreen(100);
delay(500);
}
for(int k = 0;k < 3;k++)
{
flashRed(100);
delay(500);
}
Serial.println("GLITCH TARGET RDY");
}
void flashGreen(int l)
{
digitalWrite(led1,HIGH);
delay(l);
digitalWrite(led1,LOW);
}
void flashRed(int l)
{
digitalWrite(led2,HIGH);
delay(l);
digitalWrite(led2,LOW);
}
void loop() {
int x = 0;
int y = 0;
double sum = 0;
for(x = 0;x < 500; x++)
{
for(y = 0;y < 500;y++)
{
sum++;
}
}
Serial.print("500 * 500 = ");
Serial.println(sum,DEC);
if(sum != 250000.0000000)
{
flashRed(100);
}
else
{
flashGreen(100);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment