Skip to content

Instantly share code, notes, and snippets.

@conspirator
Created July 4, 2012 04:33
Show Gist options
  • Save conspirator/3045352 to your computer and use it in GitHub Desktop.
Save conspirator/3045352 to your computer and use it in GitHub Desktop.
Arduino: Jaws
/*
Jaws ( aka Blink, but different)
Start the blinking at interval at 2 seconds. With every successive loop, decrement the intervall by 100ms.
Keep looping until you get to 0, then start over at 2 seconds.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
int i = 2000; // create a 'crement var
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(i); // wait for a 1/4 second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(i); // wait for a 1/4 second
if ( i == 0) {
i = 1000;
} else {
i -= 100;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment