project bluetooth controlled car

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
MarkGeelen
Posts: 21
Joined: Wed Feb 20, 2008 2:35 pm

project bluetooth controlled car

Post 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. :cry:
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

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times

Re: project bluetooth controlled car

Post 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.

MarkGeelen
Posts: 21
Joined: Wed Feb 20, 2008 2:35 pm

Re: project bluetooth controlled car

Post by MarkGeelen »

Oke, that would be nice.

Thanks!

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times

Re: project bluetooth controlled car

Post 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).
BT_led1.fcf_avr
(7.5 KiB) Downloaded 449 times
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.

MarkGeelen
Posts: 21
Joined: Wed Feb 20, 2008 2:35 pm

Re: project bluetooth controlled car

Post by MarkGeelen »

Oke, I will try it and let you know the results.
Thanks for your effort.

Cheers Mark

MarkGeelen
Posts: 21
Joined: Wed Feb 20, 2008 2:35 pm

Re: project bluetooth controlled car

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: project bluetooth controlled car

Post 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)

MarkGeelen
Posts: 21
Joined: Wed Feb 20, 2008 2:35 pm

Re: project bluetooth controlled car

Post by MarkGeelen »

Hi Benj,

It works; thanks!

Cheers Mark

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times

Re: project bluetooth controlled car

Post 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.

MarkGeelen
Posts: 21
Joined: Wed Feb 20, 2008 2:35 pm

Re: project bluetooth controlled car

Post by MarkGeelen »

Yes, it also works in that way. :mrgreen:

Thanks Sean and Benj for your replies.

Cheers Mark

Post Reply