daeunlee

modify

No preview for this file type
...@@ -6,7 +6,7 @@ int state = 0; ...@@ -6,7 +6,7 @@ int state = 0;
6 int KeypadRead() 6 int KeypadRead()
7 { 7 {
8 int i, keypadnum = -1; 8 int i, keypadnum = -1;
9 - for (i = 0; i < 2; i++) { 9 + for (i = 0; i < 5; i++) {
10 if (!digitalRead(Keypad[i])) { 10 if (!digitalRead(Keypad[i])) {
11 state = 1; 11 state = 1;
12 keypadnum = i; break; 12 keypadnum = i; break;
...@@ -37,7 +37,7 @@ int main(void) ...@@ -37,7 +37,7 @@ int main(void)
37 pinMode(LedRed[i], OUTPUT); 37 pinMode(LedRed[i], OUTPUT);
38 digitalWrite(LedRed[i], LOW); 38 digitalWrite(LedRed[i], LOW);
39 } 39 }
40 - for (i = 0; i < 2; i++) 40 + for (i = 0; i < 5; i++)
41 pinMode(Keypad[i], INPUT); 41 pinMode(Keypad[i], INPUT);
42 if (wiringPiISR(Keypad[2], INT_EDGE_FALLING, &stop) < 0) { 42 if (wiringPiISR(Keypad[2], INT_EDGE_FALLING, &stop) < 0) {
43 return 1; 43 return 1;
......