All pastes #837605 Raw Edit

Untitled

public c v1 · immutable
#837605 ·published 2007-12-29 20:27 UTC
rendered paste body
// 28 dec 07// WOOT machineint leds[] = {2,3,4,5,6,7,8};#define COLS 24int C[COLS][7] = {                 {1,1,1,1,1,1,1}, // W start                {0,1,0,0,0,0,0},                {0,0,1,0,0,0,0},                {0,1,0,0,0,0,0},                {1,1,1,1,1,1,1}, // W end                {0,0,0,0,0,0,0},                {0,0,0,0,0,0,0},                {1,1,1,1,1,1,1}, // O start                {1,0,0,0,0,0,1},                {1,0,0,0,0,0,1},                {1,1,1,1,1,1,1}, // O end                {0,0,0,0,0,0,0},                {0,0,0,0,0,0,0},                {1,1,1,1,1,1,1}, // O start                {1,0,0,0,0,0,1},                {1,0,0,0,0,0,1},                {1,1,1,1,1,1,1}, // O end                {0,0,0,0,0,0,0},                {0,0,0,0,0,0,0},                {0,0,0,0,0,0,1}, // T start                {0,0,0,0,0,0,1},                {1,1,1,1,1,1,1},                {0,0,0,0,0,0,1},                                {0,0,0,0,0,0,1},                               };void setup() {  for(int i=0;i<7;i++) {    pinMode(leds[i],OUTPUT);    digitalWrite(leds[i],HIGH);  }}void on(int pin) {  digitalWrite(leds[pin],LOW);}void off(int pin) {  digitalWrite(leds[pin],HIGH);}int row = 0; // keep track of current rowint col = 0; // keep track of current columnint delaytime = 2;void loop() {  for(row=0; row<8; row++) {    if( C[col][row] == 1 ) { // should be on      on(row);    } else {      off(row);    }  }      delay(delaytime);      col += 1;  if (col > COLS) {     col = 0;    for(row=0; row<8; row++) {      off(row);    }    delay( 10*delaytime*COLS );  }}