Hi. I posted same problem a few days ago but still couldn't do it.I hope you can help. My problem is, I get data from bluetooth and can print it on 16x2 lcd. But I need to know lenght of coming data in order to complate my other project. Also if you know how I can write this data to SD card without knowing number of digits, it would be even better.(I use mikro C) This time I am posting whole code. I tried different things and this is final form.
It says at while line, "pointer required."
Code:
char gelen;
char txt;
unsigned short k=0;
sbit LCD_RS at RB2_bit;
sbit LCD_EN at RB3_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB0_bit;
sbit LCD_D7 at RB1_bit;
sbit LCD_RS_Direction at TRISB2_bit;
sbit LCD_EN_Direction at TRISB3_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB0_bit;
sbit LCD_D7_Direction at TRISB1_bit;
void main() {
ADCON1 |= 0X0F;
CMCON |= 7;
Lcd_Init();
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1, 1, "Bluetooth-hc05");
delay_ms(2000);
Lcd_Cmd(_LCD_CLEAR);
UART1_Init(2400);
Delay_ms(100);
for( ; ;)
{
if (UART1_Data_Ready()) {
gelen = UART1_Read();
while(gelen[k] != '\0'){
k++;
}
ShortToStr(k, txt);
Lcd_Chr_Cp(txt);
}
}
}