/* 'Final' combination lock * Kevin Cox * kevin.cox@nyu.edu */ const int numSwitches = 3; int switches[numSwitches] = { 2, 3, 4 }; int led = 12; const int ledCount = 9; int leds[ledCount] = { 5, 6, 7, 8, 9, 10, 11, 12, 13 }; const int codeLength = 9; // this is the code int code[codeLength] = { 2, 1, 0, 1, 0, 2, 0, 2, 1 }; // 2, 1, 0, 2, 1, 0, 2, 1, 0 }; int input[codeLength]; int codeCount, waitForLow; boolean locked; void setup() { Serial.begin(9600); locked = true; codeCount = 0; waitForLow = -1; pinMode(switches[0], INPUT); pinMode(switches[1], INPUT); pinMode(switches[2], INPUT); for(int ld=0; ld0; times--) { blink(pin,ms); } }