Attachment 'ej_delay.c'
Download 1 #include <pic/p16f877a.h>
2 #define FOSC_HZ 20000000
3
4 #include <uart.h>
5 #include <pinio.h> /*define los PIN_XY*/
6 #include <delayms.h>
7
8 int main (void)
9 {
10 char c=0;
11 char INTRO[8]="TECLEA\n";
12 int T=100;
13
14 delayms(100);
15
16 uart_open(SET_115200_8N1);
17
18 uart_puts(INTRO);
19 while(c!=13)
20 {
21 if(uart_kbhit()==1)
22 {
23 c=uart_getc()-'0';
24 uart_putc(c+'0');
25 T=100*c;
26 }
27 delayms(T);
28 output_high(PIN_C2);
29 delayms(T);
30 output_low(PIN_C2);
31 }
32 uart_close();
33
34 return 0;
35 }
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.