Doubt regarding usage of a certain function in 8051 based bluetooth home automation

aditya nukala's picture

Offline

Joined: Apr 19, 2018

Replies: 2
Doubt regarding usage of a certain function in 8051 based bluetooth home automation
December 8, 2018 - 12:47pm

I have read your project of 8051 based bluetooth control home automation.After understanding I implemented it but the bluetooth didn't give any response.Later I read your code and used the function Serialwrite(0x0d) and it worked.Without this statement the bluetooth is not responding.My question is transmitting 0x0d ,what does that signify?

Jayant's picture

Offline

Joined: May 19, 2015

Replies: 209
you have to use carriage return (0x0d)
December 9, 2018 - 4:07pm

Yes aditya you have to write 0x0d everytime  before you send a data.

Accordig to ASCII table the value 0x0d represetns carriage return (Enter key). So the blutooth module should recevice a carriage return everytime before you send the data 

aditya nukala's picture

Offline

Joined: Apr 19, 2018

Replies: 2
Reason to use 0x0d ?
December 13, 2018 - 7:12pm

I have read about carriage return.It is simply putting cursor to first position.Could you explain why just putting a cursor in first position (carriage return) is very much important?

Jayant's picture

Offline

Joined: May 19, 2015

Replies: 209
That's how Bluetooth protocol works
December 14, 2018 - 1:07pm

You net to read the bluetooth datasheet if you wanna get more into it.

During a communication data is always appended by /n/r where /n stands for new line this new line is given by the carriage return which is mandatory in our case. This is how the luetooth module will know that its the end of data and it should transmit what ever was received so far.

Hope you get the point