schematic Quickpost this image to Myspace, Digg, Facebook, and others! code working: If you press any button in the matrix keyboard it controller will scan the corresponding ascii code that will send serially to the port pin specified . Corresponding ascii code we can see in LED blinkings. #include /* add the headers here */ #define COL P2 #define ROW P1 void msdelay(unsigned int value); void sertx(unsigned char); unsigned char keyboard[4][4]={ '7','8','9','/', '4','5','6','*', '1','2','3','-', 'a','0','=','+' }; void main() { unsigned char colloc,rowloc; TMOD=0x20; TH1=-24; SCON=0x50; TR1=1; COL=0xff; while(1) { do { ROW=0x00; colloc=COL; colloc&=0x0f; } while(colloc!=0x0f); do { do { msdelay(20); colloc=COL; colloc&=0x0f; }while(colloc==0x0f); msdelay(20); colloc=COL; colloc&=0x0f; } while(colloc==0x0f); while(1) { ROW=0xfe; colloc=COL; colloc...
Comments
Post a Comment