15,899,754 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by shsmszdh (Top 9 by date)
shsmszdh
1-Jul-16 19:09pm
View
I activated gcc mode by this code:
Code:
#include
int main(void) {
set_sleep_mode(SLEEP_MODE_IDLE);
sei();
sleep_mode();
and I saw just this error :
Error: C:\cvavreval\inc\usart.h(40), included from: hc05.h: invalid #include directive
line 40 is:int main(void) {
and i changed the line into :
Code:
void main(void){
or even
Code:
void main(){
and again i saw the same error
please tell me what to do ?
shsmszdh
30-Jun-16 7:26am
View
hc05.h includes :
io.h
delay.h
usart.h
string.h
shsmszdh
30-Jun-16 7:24am
View
hc11.c is :
#include<io.h>
/*Includes io.h header file where all the Input/Output Registers and its Bits are defined for all AVR microcontrollers*/
#define F_CPU 8000000
/*Defines a macro for the delay.h header file. F_CPU is the microcontroller frequency value for the delay.h header file. Default value of F_CPU in delay.h header file is 1000000(1MHz)*/
#include<delay.h>
/*Includes delay.h header file which defines two functions, _delay_ms (millisecond delay) and _delay_us (microsecond delay)*/
#include<hc05.h>
/*Includes hc05.h header file which defines different functions for HC-05 Bluetooth Module. HC-05 header file version is 1.1*/
void main(void)
{
delay_ms(500);
delay_ms(500);
/*Delay of 1s*/
usart_init();
/*USART initialization*/
hc_05_bluetooth_transmit_string("ABLab Solutions");
/*Transmits a string to Bluetooth Module*/
hc_05_bluetooth_transmit_byte(0x0d);
/*Transmits Carriage return to Bluetooth Module*/
hc_05_bluetooth_transmit_byte(0x0a);
/*Transmits New Line to Bluetooth Module for new line*/
hc_05_bluetooth_transmit_string("www.ablab.in");
/*Transmits a string to Bluetooth Module*/
hc_05_bluetooth_transmit_byte(0x0d);
/*Transmits Carriage return to Bluetooth Module*/
hc_05_bluetooth_transmit_byte(0x0a);
/*Transmits New Line to Bluetooth Module for new line*/
}
/*End of program*/
please help me!!!
shsmszdh
30-Jun-16 7:23am
View
continue of hc05.h :
// unsigned char i=9,j=0;
UBRRL=12;
delay_ms(500);
unsigned char i=9,j=0;
usart_string_transmit("AT+VERSION?");
usart_data_transmit(0x0d);
usart_data_transmit(0x0a);
usart_string_receive(hc_05_buffer2,13);
temp=usart_data_receive();
usart_string_receive(hc_05_buffer1,13);
temp=usart_data_receive();
for(i=9;hc_05_buffer2[i]!=0;i++)
{
hc_05_buffer2[j]=hc_05_buffer2[i];
j++;
}
hc_05_buffer2[j]=0;
if(!(strcmp(hc_05_buffer1,"OK")))
{
return 1;
}
else
{
return 0;
}
}
unsigned char hc_05_bluetooth_pin_change(char *new_pin)
{
UBRRL=12;
delay_ms(500);
usart_string_transmit("AT+PSWD=");
usart_string_transmit(new_pin);
usart_data_transmit(0x0d);
usart_data_transmit(0x0a);
usart_string_receive(hc_05_buffer1,13);
temp=usart_data_receive();
if(!(strcmp(hc_05_buffer1,"OK")))
{
return 1;
}
else
{
return 0;
}
}
#endif
shsmszdh
30-Jun-16 7:21am
View
thanks I did that but I also saw these errors:
Error: C:\cvavreval\inc\usart.h(115), #include-d from: hc05.h: undefined symbol 'unsigned'
Error: C:\cvavreval\inc\usart.h(115), #include-d from: hc05.h: ';' expected, but ')' found
Error: C:\cvavreval\inc\usart.h(119), #include-d from: hc05.h: out of context
Error: C:\cvavreval\inc\hc05.h(68), #include-d from: hc11.c: undefined symbol 'unsigned'
Error: C:\cvavreval\inc\hc05.h(68), #include-d from: hc11.c: ';' expected, but ')' found
Error: C:\cvavreval\inc\hc05.h(72), #include-d from: hc11.c: out of context
Error: C:\cvavreval\inc\hc05.h(193), #include-d from: hc11.c: must declare first in block
hc05.h is :
#ifndef _HC05_H_
#define _HC05_H_ 1
#include<io.h>
#include<delay.h>
#include<usart.h>
#include<string.h>
char hc_05_buffer1[25], hc_05_buffer2[50];
char temp;
unsigned char i;
void hc_05_bluetooth_transmit_byte(char data_byte);
char hc_05_bluetooth_receive_byte(void);
void hc_05_bluetooth_transmit_string(char *transmit_string);
void hc_05_bluetooth_transmit_command(char *transmit_string);
char *hc_05_bluetooth_receive_string(char *receive_string, unsigned char terminating_character);
unsigned char hc_05_bluetooth_at_command_mode_test(void);
unsigned char hc_05_bluetooth_device_name_change(char *device_name);
unsigned char hc_05_bluetooth_get_version(void);
unsigned char hc_05_bluetooth_change_baud_rate(long int baud_rate);
unsigned char hc_05_bluetooth_pin_change(char *new_pin);
void hc_05_bluetooth_transmit_byte(char data_byte)
{
usart_data_transmit(data_byte);
}
char hc_05_bluetooth_receive_byte(void)
{
return usart_data_receive();
}
void hc_05_bluetooth_transmit_string(char *transmit_string)
{
usart_string_transmit(transmit_string);
}
char *hc_05_bluetooth_receive_string(char *receive_string, unsigned char terminating_character)
{
unsigned char temp=0x00;
// unsigned char i;
for(unsigned char i=0;;i++)
{
*(receive_string+i)=usart_data_receive();
if(*(receive_string+i)==terminating_character)
break;
else
temp++;
}
*(receive_string+temp)='\0';
return receive_string;
}
unsigned char hc_05_bluetooth_at_command_mode_test(void)
{
UBRRL=12;
delay_ms(500);
usart_string_transmit("AT");
usart_data_transmit(0x0d);
usart_data_transmit(0x0a);
usart_string_receive(hc_05_buffer1,0x0d);
temp=usart_data_receive();
if(!(strcmp(hc_05_buffer1,"OK")))
{
return 1;
}
else
{
return 0;
}
}
unsigned char hc_05_bluetooth_change_baud_rate(long int baud_rate)
{
UBRRL=12;
delay_ms(500);
if(baud_rate==4800)
{
usart_string_transmit("AT+UART=4800,0,0");
}
else if(baud_rate==9600)
{
usart_string_transmit("AT+UART=9600,0,0");
}
else if(baud_rate==19200)
{
usart_string_transmit("AT+UART=19200,0,0");
}
else if(baud_rate==38400)
{
usart_string_transmit("AT+UART=38400,0,0");
}
else if(baud_rate==57600)
{
usart_string_transmit("AT+UART=57600,0,0");
}
else if(baud_rate==115200)
{
usart_string_transmit("AT+UART=115200,0,0");
}
else if(baud_rate==230400)
{
usart_string_transmit("AT+UART=230400,0,0");
}
else if(baud_rate==460800)
{
usart_string_transmit("AT+UART=460800,0,0");
}
else if(baud_rate==921600)
{
usart_string_transmit("AT+UART=921600,0,0");
}
else if(baud_rate==1382400)
{
usart_string_transmit("AT+UART=1382400,0,0");
}
else
{
;
}
usart_data_transmit(0x0d);
usart_data_transmit(0x0a);
usart_string_receive(hc_05_buffer1,13);
temp=usart_data_receive();
if(!(strcmp(hc_05_buffer1,"OK")))
{
return 1;
}
else
{
return 0;
}
}
unsigned char hc_05_bluetooth_device_name_change(char *device_name)
{
UBRRL=12;
delay_ms(500);
usart_string_transmit("AT+NAME=");
usart_string_transmit(device_name);
usart_data_transmit(0x0d);
usart_data_transmit(0x0a);
usart_string_receive(hc_05_buffer1,13);
temp=usart_data_receive();
if(!(strcmp(hc_05_buffer1,"OK")))
{
return 1;
}
else
{
return 0;
}
}
// unsigned char i=9,j=0;
unsigned char hc_05_bluetooth_get_version(void)
{
// unsigned
shsmszdh
30-Jun-16 7:10am
View
I saw those first 66 lines of usart.h but there were no warning for them after I selected build all button !!!!!!!!!!!!!!!!
shsmszdh
28-Jun-16 16:48pm
View
thanks for your suggestion I did it and errors reduced to these: please help me
Error: C:\cvavreval\inc\usart.h(114), #include-d from: hc05.h: undefined symbol 'unsigned'
Error: C:\cvavreval\inc\usart.h(114), #include-d from: hc05.h: undefined symbol 'i'
Error: C:\cvavreval\inc\usart.h(117), #include-d from: hc05.h: undefined symbol 'i'
Error: C:\cvavreval\inc\hc05.h(67), #include-d from: hc1.c: undefined symbol 'unsigned'
Error: C:\cvavreval\inc\hc05.h(67), #include-d from: hc1.c: undefined symbol 'i'
Error: C:\cvavreval\inc\hc05.h(70), #include-d from: hc1.c: undefined symbol 'j'
Error: C:\cvavreval\inc\hc05.h(188), #include-d from: hc1.c: must declare first in block
shsmszdh
28-Jun-16 16:46pm
View
thanks i did your suggestion and errors reduced to these: please help me
Error: C:\cvavreval\inc\usart.h(114), #include-d from: hc05.h: undefined symbol 'unsigned'
Error: C:\cvavreval\inc\usart.h(114), #include-d from: hc05.h: undefined symbol 'i'
Error: C:\cvavreval\inc\usart.h(117), #include-d from: hc05.h: undefined symbol 'i'
Error: C:\cvavreval\inc\hc05.h(67), #include-d from: hc1.c: undefined symbol 'unsigned'
Error: C:\cvavreval\inc\hc05.h(67), #include-d from: hc1.c: undefined symbol 'i'
Error: C:\cvavreval\inc\hc05.h(70), #include-d from: hc1.c: undefined symbol 'j'
Error: C:\cvavreval\inc\hc05.h(188), #include-d from: hc1.c: must declare first in block
shsmszdh
28-Jun-16 16:45pm
View
thanks for your suggestions I did them and errors reduced to these:
Error: C:\cvavreval\inc\usart.h(114), #include-d from: hc05.h: undefined symbol 'unsigned'
Error: C:\cvavreval\inc\usart.h(114), #include-d from: hc05.h: undefined symbol 'i'
Error: C:\cvavreval\inc\usart.h(117), #include-d from: hc05.h: undefined symbol 'i'
Error: C:\cvavreval\inc\hc05.h(67), #include-d from: hc1.c: undefined symbol 'unsigned'
Error: C:\cvavreval\inc\hc05.h(67), #include-d from: hc1.c: undefined symbol 'i'
Error: C:\cvavreval\inc\hc05.h(70), #include-d from: hc1.c: undefined symbol 'j'
Error: C:\cvavreval\inc\hc05.h(188), #include-d from: hc1.c: must declare first in block
Show More