// Simulate(Uno) link sketch to Arduino board here
const int LED = 5;
int count = 0;
int threshold = 0;
int threshold_max;
void setup() {
// put your setup code here, to run once:
pinMode(LED, OUTPUT);
Serial.begin(9600);
Serial.println("Please Select Your Threshold Value");
Serial.println("Please note that only Integers Can be Selected");
while (threshold == 0){
if (Serial.available()){
threshold = Serial.parseInt();
threshold_max = threshold + 10;
Serial.print("Your Selected Threshold Value is ");
Serial.println(threshold);
}
}
}
void loop() {
Serial.print("The number now is ");
Serial.println(count);
if (count < threshold){
Serial.println("It is below your Threshold!");
delay(500);
} else if (count == threshold){
digitalWrite (LED, HIGH);
Serial.println("This is the End!...... Maybe?");
delay(500);
} else if (count > threshold && count < threshold_max){
Serial.println("This is getting out of hand!");
delay(500);
} else if (count >= threshold_max){
Serial.println("It is exploding!!!!!!");
digitalWrite (LED, LOW);
delay(250);
digitalWrite (LED, HIGH);
delay(250);
}
count ++;
}