Attachment 'ej_keypad4x4flex.c'
Download 1 #include <pic/p16f877a.h>
2 #define FOSC_HZ 20000000
3
4 #define ROW0 PIN_B0
5 #define ROW1 PIN_B1
6 #define ROW2 PIN_B2
7 #define ROW3 PIN_B3
8 #define COL0 PIN_B4
9 #define COL1 PIN_B5
10 #define COL2 PIN_B6
11 #define COL3 PIN_B7
12
13 #include <uart.h>
14 #include <keypad4x4flex.h>
15 #include <delayms.h>
16
17 int main (void)
18 {
19 char tmp;
20 char INTRO[]="PRESIONA UNA TECLA\n";
21
22 TRISB=0xFF;
23 TRISC=0xFF;
24
25 delayms(100);
26
27 uart_open(SET_9600_8N1);
28 set_pullup_portb(TRUE);
29 uart_puts(INTRO);
30
31 while(TRUE)
32 {
33 delayms(200);
34 tmp = kbd_getchar();
35 uart_putc(tmp);
36 }
37 return 0;
38 }
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.