hi everyone ,
my project is simple :
I'am using 16f877A PIC microcontroller , hc05 bluetooth module
if I send a letter(ex: 'a') via terminal on my mobile phone it turns on all port b legs
but its not working
i wrote a code to echo what has been received and its working , it receives the information from my mobile correctly
here is my code :
wrote on mikroC pro for pic
a picture of the terminal on my mobile phone: https://i.imgur.com/ApjTfFa.png
ps: everything works fine on protus
but not in real life :/
my project is simple :
I'am using 16f877A PIC microcontroller , hc05 bluetooth module
if I send a letter(ex: 'a') via terminal on my mobile phone it turns on all port b legs
but its not working
i wrote a code to echo what has been received and its working , it receives the information from my mobile correctly
here is my code :
C:
=======================
unsigned char uart_rd ;
char* data_r = "data received: ";
main()
{
trisb =0 ;
portb =0 ;
UART1_init(9600);
delay_ms(200) ;
while(1)
{
if ( UART1_Data_Ready() )
{
uart_rd = UART1_Read() ;
UART1_Write_Text(data_r);
UART1_Write(uart_rd) ;
}
if ( uart_rd == 'a')
portb=0b11111111 ;
else if ( uart_rd == 'b' )
portb =0b00000000 ;
UART1_Write(x);
}
}
======================
a picture of the terminal on my mobile phone: https://i.imgur.com/ApjTfFa.png
ps: everything works fine on protus
but not in real life :/
Last edited by a moderator: