Bluetooth connection drops very often in Bricx

View: New views
4 Messages — Rating Filter:   Alert me  

Bluetooth connection drops very often in Bricx

by bigboss97 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm using BricxCC and whenever I've changed something (even a single number) I've to download my program to my NXT. It's a bit slow. But I can live with that. The worst thing is that the connection drops during or after the download quite often (even my NXT just seats next to my Bluetooth dongle).

Questions:
1) How can I get my connection more stable?
2) Alternatively, how can I reduce my downloads?

thanks
Phuoc
........................
www.folksfun.com
........................

Re: Bluetooth connection drops very often in Bricx

by Rafe Donahue :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In lugnet.robotics, bigboss97 <bigboss97.geo@...> wrote:
> 2) Alternatively, how can I reduce my downloads?
>

I cannot aid with the Bluetooth issues but I have a strategy that I use to when
programming my Lego things that helps me change numbers without the cycle of
program, save, download, run.

I write the program with, for lack of a better term, smart parameters and then
include the ability to physically change them through things like push buttons
or other inputs.  

Here's a dumb little example:

Say I have to make the machine wait between doing certain tasks.  ("I have to
make the machine wait between doing certain tasks."  Yes, got it.  Thank you,
smart-alecs.)  I don't know if it should wait 1, 2, 3, or 4 seconds.  So I
create a variable that holds the wait time.  Then program something like a touch
sensor to change the wait time every time it is pushed, so that if it were at 1,
it goes to 2; at 2, it goes to 3; at 3, it goes to 4; at 4, it goes to 1.  That
way, you program once but get to test all four options.

Of course, with NXT, you could use the rotation sensor built into the motors to
detect position and use that to control the parameters.

You can even have it give you feedback (sound or something on the screen) to let
you know that it knows what the right value is.

Whenever I am programming now, I think about the parameters I will need and try
to come up with a way to control them while the machine is running so that I
don't have to do the downloads.  

Maybe said another way: avoid hard-coding.

At the start, more programming is required but testing goes a lot fast at the
end because you can control and change things without having to reprogram and
download.

I'm guessing that that is just good programming techniques but it took me a
while to figure out, but I'm sure glad I did.

Ok, that's that.
Rafe

Re: Bluetooth connection drops very often in Bricx

by John Hansen-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In lugnet.robotics, bigboss97 <bigboss97.geo@...> wrote:
> I'm using BricxCC and whenever I've changed something (even a single number)
> I've to download my program to my NXT. It's a bit slow. But I can live with
> that. The worst thing is that the connection drops during or after the
> download quite often (even my NXT just seats next to my Bluetooth dongle).
>
> Questions:
> 1) How can I get my connection more stable?
> 2) Alternatively, how can I reduce my downloads?


It sounds to me like you are running BricxCC with it configured to launch the
NBC compiler executable rather than telling it to use the built-in version of
the NBC compiler.  In this mode a) it is a bit slow, and b) the connection drops
during/after the download.

If you use a BricxCC and you use a Bluetooth connection to communicate with your
NXT then you absolutely need to tell BricxCC to use the built-in NBC compiler.
This option should be on the Preferences|Compiler|NBC/NXC tab.  If you do not
see this option then you need to install the latest BricxCC test release over
the top of your existing BricxCC install.  

http://bricxcc.sourceforge.net/test_release.zip

Let me know if this helps or not.

John Hansen

Re: Bluetooth connection drops very often in Bricx

by bigboss97 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi John,
Great! It works now almost in zero time.

thanks
Phuoc

John Hansen-4 wrote:
If you use a BricxCC and you use a Bluetooth connection to communicate with your
NXT then you absolutely need to tell BricxCC to use the built-in NBC compiler.
This option should be on the Preferences|Compiler|NBC/NXC tab.
........................
www.folksfun.com
........................
LightInTheBox - Buy quality products at wholesale price