SHARE
TWEET

PIC - Terminal 232 con LCD 4x20

Electgpl Jun 19th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <16F883.h>
  2. #use delay(clock=20000000)
  3. #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
  4. #include <lcd420.c>
  5. void main(){
  6.    lcd_init();
  7.    char varInt;
  8.    int8 contChar=0, contReng=1;
  9.    while(TRUE){
  10.       if(kbhit()){
  11.          varInt=getch();        
  12.          contChar++;
  13.       }
  14.       if(contChar>20){
  15.          contChar=1;
  16.          contReng++;
  17.       }
  18.       if(contReng>4)
  19.          contReng=1;
  20.       lcd_gotoxy(contChar,contReng);  
  21.       printf(lcd_putc,"%c",varInt);
  22.    }
  23. }
RAW Paste Data
Want to get better at C?
Learn to code C in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top