#include <16F877A.h>
#use delay(clock=20M)
#fuses HS,NOWDT,NOPUT,NOLVP,NOBROWNOUT,NOWRT,NOPROTECT
#use RS232 (baud=9600, bits=8, parity=N, xmit=pin_c6, rcv=pin_c7)
#use fast_IO(B)
char d='x';
#int_rda
void inter_serie(){
d='x';
if(kbhit()){
d=getc();
}}
void main(void)
{
set_tris_B(0x00);
enable_interrupts(global);
enable_interrupts(int_rda);
output_high(pin_B0) ;
delay_ms(1000);
output_low(pin_B0) ;
while(true){
if(d=='1'){
output_high(pin_B0) ;
}
if(d=='2'){
output_low(pin_B0) ;
}
delay_ms(50);
}
}
No hay comentarios:
Publicar un comentario