Skip to content

Instantly share code, notes, and snippets.

@djmitche
Created January 24, 2010 00:09
Show Gist options
  • Select an option

  • Save djmitche/284880 to your computer and use it in GitHub Desktop.

Select an option

Save djmitche/284880 to your computer and use it in GitHub Desktop.
/*
Originally By David Cuartielles
http://arduino.cc/en/Tutorial/Blink
based on an orginal by H. Barragan for the Wiring i/o board
*/
#define highpin 12
#define lowpin 7
// The setup() method runs once, when the sketch starts
void setup() {
for (int i = lowpin; i <= highpin; i++) {
pinMode(i, OUTPUT);
digitalWrite(i, HIGH);
}
}
// the loop() method runs over and over again,
// as long as the Arduino has power
void loop()
{
int i, j;
for (i = lowpin; i <= highpin; i++) {
for (j = lowpin; j <= highpin; j++) {
if (i == j)
digitalWrite(j, LOW); // common anode: on = LOW
else
digitalWrite(j, HIGH);
}
delay(200);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment