![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
working, need to fix input bouncing
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:ab859ed60719
- Parent:
- 0:b44cdf7cb6a5
- Child:
- 2:54ae225e6203
diff -r b44cdf7cb6a5 -r ab859ed60719 main.cpp --- a/main.cpp Fri Feb 13 19:22:58 2015 +0000 +++ b/main.cpp Tue Feb 17 17:57:23 2015 +0000 @@ -50,27 +50,28 @@ t1.start(); int input = 0x00; while(1) { + //make all rows 0 to add stability + row1 = 0; + row2 = 0; + row3 = 0; + row4 = 0; //Keep each led lit for 4ms switch(t1.read_ms()%4){ case 0: row1 = 1; - input |= 0x10; - row4 = 0; + input |= 0x10; break; case 1: row2 = 1; input |= 0x20; - row1 = 0; break; case 2: row3 = 1; input |= 0x40; - row2 = 0; break; case 3: row4 = 1; input |= 0x80; - row3 = 0; break; } if(col1 == 1)