Pesquisar neste blog
19/03/2020
Tela LCD + teclado com PIC 16F877A
Código feito em CCS C Compiler
#include <LCD + teclado.h>
#include <KBD.C>//driver do teclado
#define LCD_DATA_PORT getenv("SFR:PORTB")//porta padrão
#include <lcd.c>
char c;
void main(){
kbd_init();
lcd_init();
printf(lcd_putc,"\fDigite: ");
delay_ms(50);
while(TRUE){
c = kbd_getc();//retorna qual tecla foi precionada
delay_ms(2);//dando uma pausa de 2 ms para processar informação
if(c != 0){// se a tecla foi precionada
printf(lcd_putc,"%c",c);//imprindo a tecla digitada
delay_ms(300);
}
}
}
Clique aqui para fazer o download dos arquivos
Variável em CCS C Compiler
Código feito em CCS C Compiler
#include <main.h>
#use delay(clock = 20MHz)
int x;
void main(){
while(true){
output_high(PIN_B2);
delay_ms(1000);
output_low(PIN_B2);
delay_ms(1000);
x++;//cada piscada soma +1
if(x == 5){
output_high(pin_b7);
}
}
}
Assinar:
Postagens (Atom)

