// "%x" = hex // "%2u" = dec 8b // "%lu" = dec 16d #if defined(__PCB__) #include <16C56.h> #fuses HS,NOWDT,NOPROTECT #use delay(clock=4000000) #elif defined(__PCM__) #include <16F873.h> #FUSES XT #FUSES NOWDT #FUSES PUT #FUSES NOPROTECT #FUSES BROWNOUT #FUSES NOLVP #FUSES NOCPD #FUSES WRT #FUSES NODEBUG #DEVICE ADC=8 //10 bit #use delay(clock=4000000) #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,stop=1) #elif defined(__PCH__) #include <18F452.h> #fuses HS,NOWDT,NOPROTECT,NOLVP #use delay(clock=4000000) #endif //**************************************** #include //**************************************** #bit RCIF=0x0c.5 void main () { int uartin = (0); lcd_init(); lcd_putc('\f'); printf("Start data :"); //zapise text putc(0x0d); //zapis pro -> putc(0x0a); //-> skok na novy radek while (true) { OUTPUT_HIGH(PIN_C1); uartin=getc(); // uartin=uartin+(1); OUTPUT_LOW(PIN_C1); OUTPUT_HIGH(PIN_C0); delay_ms(50); OUTPUT_LOW(PIN_C0); printf("%2u",uartin); putc(0x0d); //zapis pro -> putc(0x0a); //-> skok na novy radek lcd_gotoxy(1,1); printf(lcd_putc,"\f%2u",uartin); delay_ms(200); // RCIF=1; } } //**************************************