Subject:
|
Re: Bluetooth connection drops very often in Bricx
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Fri, 11 Jul 2008 15:19:52 GMT
|
Viewed:
|
7120 times
|
| |
| |
In lugnet.robotics, bigboss97 <bigboss97.geo@yahoo.com> 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
|
|
Message is in Reply To:
| | Bluetooth connection drops very often in Bricx
|
| 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 (...) (16 years ago, 11-Jul-08, to lugnet.robotics)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|