I am currently developing an app in android
that sends a string
to a bluetooth module HC06 and is picked up by a pic 16f883.
I created an interruption that makes it appear on the lcd when the plot arrives, but I do not know how I can capture it, save it in a buffer and this in turn stores it in memory.
#include <16F883.h>
#fuses HS,NOWDT,PROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7)
#include <flex_lcd.c>
#include <stdlib.h>
//FUNCIONES
void inicio();
//VARIABLES
char mivariable;
int i;
int contador=1;
//INTERRUPCION
#INT_RDA // Interrupccion USART
void RDA_isr()
{
output_high(pin_A2);
if(contador==16){
contador=1;
printf(lcd_putc, "f");
lcd_gotoxy(1,1);
printf(lcd_putc,"BLUETOOTH_2");
}
mivariable = getc();
lcd_gotoxy(contador,2);
lcd_putc(mivariable);
contador++;
output_low(PIN_A2);
}
void main()
{
inicio();
while (true)
{
}
}
//INICIO LCD CON CARGA....
void inicio(){
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
delay_ms(100);
lcd_init();
output_high(pin_A2);
lcd_gotoxy(1,1);
printf(lcd_putc, "Loading");
for(i=1;i<=16;i++){
lcd_gotoxy(i,2);
printf(lcd_putc, "*");
delay_ms(200);
}
printf(lcd_putc, "f");
lcd_gotoxy(1,1);
printf(lcd_putc,"BLUETOOTH_2");
output_low(PIN_A2);
}