Page 1 of 1
project bluetooth controlled car
Posted: Mon Apr 28, 2008 3:00 pm
by MarkGeelen
Hi,
I am doing my graduation project with your E-blocks. I'm making a bluetooth controlled car. A bit like RC car. I use the standard E-blocks in stead of the formula flowcode. I have the bluetooth E-block, the microcontroller board with Atmega 32 applied on it. Flowcode 3 for AVR .
I also use the motorboard, to control the direction of the motors. The chassis is the same as applied on the formula flowcode buggy.
Now I have the following problem.
I am programming the bluetooth board so that I can send over Characters over with hyperterminal. This works, but only slow.
I have to type the characters a few times before the microcontroller reacts. It is working then, but I want to have a quicker reaction. Is there a solution for this? Or is this always so slow?
Can you help me with this one? Sorry if I posted in the wrong subforum.
Greetings Mark
Re: project bluetooth controlled car
Posted: Tue Apr 29, 2008 5:30 pm
by Sean
I will be testing some AVR/Bluetooth applications this week - starting with Hyperterminal links - so I hope to have some information for you soon.
Re: project bluetooth controlled car
Posted: Wed Apr 30, 2008 9:41 am
by MarkGeelen
Oke, that would be nice.
Thanks!
Re: project bluetooth controlled car
Posted: Wed Apr 30, 2008 9:48 am
by Sean
I have attached a program that seems to provide a fast and reliable link between Hyperterminal and the Bluetooth E-Block (EB-024).
The simple demo program accepts a numeric character from Hyperterminal ('0' - '7'), sets the corresponding output on Port A, and returns a text character to Hyperterminal ('a' - 'h').
The EB-024 Bluetooth board is connected to Port D with the following hardware configuration:
Jumper links on J13, J14, J15, J16.
Wire links
P1 - TX to P2 - 0
P1 - RX to P2 - 1
P1 - CTS to P2 - 6
P1 - RTS to P2 - 7
Note: the CTS and RTS pins are assigned in the Bluetooth component properties and can be changed if necessary.
Re: project bluetooth controlled car
Posted: Wed Apr 30, 2008 10:26 am
by MarkGeelen
Oke, I will try it and let you know the results.
Thanks for your effort.
Cheers Mark
Re: project bluetooth controlled car
Posted: Thu May 01, 2008 1:58 pm
by MarkGeelen
Hi,
It works a lot better as my own solution.
It works much quicker.
Thanks for your example file! It really helpt.
I have another question.
In hyperterminal I want to send a carriage return, so that the next command starts on a new line, this makes the whole more readable.
How do you implement this in flowcode? It is not working with the sendcommand function.
Thanks a lot!
Cheers Mark
Re: project bluetooth controlled car
Posted: Thu May 01, 2008 3:53 pm
by Benj
Hello Mark
A carrage return is the equivalent of sending a decimal value of 13. You may also need to send a line feed character (10) to get hyperterminal to respond correctly.
So you would do the following,
SendRS232 (13)
SendRS232 (10)
Re: project bluetooth controlled car
Posted: Thu May 01, 2008 4:40 pm
by MarkGeelen
Hi Benj,
It works; thanks!
Cheers Mark
Re: project bluetooth controlled car
Posted: Thu May 01, 2008 5:55 pm
by Sean
The SendCommand function sends a carrage return character (0x0d) if its second parameter (bSendCR(BYTE)) is a 1. In Hyperterminal this normally returns the cursor to the start of the current line, and any subsequent text overwrites the existing text.
In Hyperterminal it is possible to force a received carrage return character to have a line feed character (0x0a) added, forcing the cursor to the start of the next line.
In Hyperterminal, go to Connection Properties -> Settings -> ASCII Setup. In the ASCII Receiving section check the "Append line feeds to incomming line ends" checkbox. This should allow each line of text to be shown on a separate display line.
Re: project bluetooth controlled car
Posted: Tue May 06, 2008 9:45 am
by MarkGeelen
Yes, it also works in that way.
Thanks Sean and Benj for your replies.
Cheers Mark