Datasheet

1: kp := 49; // 1 // Uncomment this block for keypad4x4
2: kp := 50; // 2
3: kp := 51; // 3
4: kp := 65; // A
5: kp := 52; // 4
6: kp := 53; // 5
7: kp := 54; // 6
8: kp := 66; // B
9: kp := 55; // 7
10: kp := 56; // 8
11: kp := 57; // 9
12: kp := 67; // C
13: kp := 42; // *
14: kp := 48; // 0
15: kp := 35; // #
16: kp := 68; // D
end;
if (kp <> oldstate) then // Pressed key differs from
previous
begin
cnt := 1;
oldstate := kp;
end
else // Pressed key is same as previous
Inc(cnt);
Lcd_Chr(1, 10, kp); // Print key ASCII value on Lcd
if (cnt = 255) then // If counter varialble overflow
begin
cnt := 0;
Lcd_Out(2, 10, ' ');
end;
WordToStr(cnt, txt); // Transform counter value to string
Lcd_Out(2, 10, txt); // Display counter value on Lcd
end;
end.
252
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6