Test Pattern 2
void allOff() { for(int i=3; i<8; i++) { digitalWrite(i, HIGH); } for ( int i = 8; i < 14; i++) { digitalWrite(i,LOW); } } void setup() { // initialize the digital pin as an output: for(int i=3; i<14; i++) { pinMode(i, OUTPUT); } allOff(); } // the loop() method runs over and over again, // as long as the Arduino has power void loop() { for (int column = 3; column < 8; column++) { for (int row = 8; row < 14; row++) { allOff(); digitalWrite(row,HIGH); digitalWrite(column,LOW); delay(500); } } }
page revision: 2, last edited: 06 Dec 2009 19:26