scanovani tlacitek

Jakub Slajs xslajsj at yahoo.com
Mon Aug 13 14:14:20 CEST 2001


Zdravim,

Zkuste hledat na strankach Atmelu: AVR242: 8-bit Microcontroller
Multiplexing LED Drive and a 4 x 4 Keypad.

Je tam na prikladu hodin ukazano pripojeni 16 klaves a 4
mistneho
7 segm. displeje k procesoru AT90S1200 (schema, popis, vyvojak,
zdrojak). Tlacitka jsou zapojena do matice 4 x 4 a nejprve se
privadi napeti do vsech sloupcu a scanuji se radky a pote se
postup obrati.

switch (row) {
  case 1: Key = 0; break
  case 2: Key = 4; break;
  case 3: Key = 8; break;
  case 4: Key = 12; break;
}

swapPort(); delay();

switch (col) {
  case 1: Key = Key + 0; break;
  case 2: Key = Key + 1; break;
  case 3: Key = Key + 2; break;
  case 4: Key = Key + 3; break;
}

S pozdravem,

Jakub Slajs



__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/






More information about the HW-list mailing list