xbee + sk40c

Bluetooth, XBee, RF......

xbee + sk40c

Postby atikahIsmail » Mon Nov 18, 2013 4:01 pm

i have write the code same like the tutorial at http://tutorial.cytron.com.my/2011/07/3 ... ontroller/ but there are some error..i don't know where the mistake..because this is first time i try to write in C..can u help me..

#include <pic.h>
#include <htc.h>
#include <string.h>

void uart_init(void)
{
SPBRG=129;
BRGH=1;
TXEN=1;
TX9;
RX9;
CREN=1;
SPEN=1;
}

unsigned char uart_rec(void)
{
unsigned int rec_data;
while(RCIF==0);
rec_data = RCREG;
return rec_data;
}

void uart_send(unsigned char data)
{
while(TXIF==0);
TXREG=data;
}

void uart_str(const char *s)
{
while(*s)uart_send(*s++);
}

void main(void)
{
uart_str(&quot;+++&quot;);
delay_ms(200);

uart_str(&quot;atmy1111&quot;);
uart_send(0xD);
delay_ms(200);

uart_str(&quot;atwr&quot;);
uart_send(0xD);
delay_ms;

uart_str(&quot;atdl2222&quot;);
uart_send(0xD);
delay_ms;

uart_str(&quot;atwr&quot;);
uart_send(0xD);
delay_ms(200);

uart_str(&quot;atcn&quot;);
uart_send(0xD);
delay_ms(200);
}
atikahIsmail
Newbie
 
Posts: 8
Joined: Fri Oct 25, 2013 10:01 am

Re: xbee + sk40c

Postby yonghui » Wed Nov 20, 2013 3:35 pm

Show us the error shown by compiler at output
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: xbee + sk40c

Postby atikahIsmail » Wed Nov 20, 2013 7:16 pm

this is the error..i still looking to solve this error..but i still can't find this
Attachments
error.jpg
atikahIsmail
Newbie
 
Posts: 8
Joined: Fri Oct 25, 2013 10:01 am

Re: xbee + sk40c

Postby yonghui » Thu Nov 21, 2013 11:33 am

U didnt write ur code properly. Double click the error in output to bring u to the line that contains error. Or find the error shown by report, got line and column there. 1st significant one u don't declare ur variable quot before use
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm


Return to Wireless Device

Who is online

Users browsing this forum: No registered users and 18 guests

cron