Subject:
|
score one for half a$$-ed programming
|
Newsgroups:
|
lugnet.org.us.laflrc
|
Date:
|
Sun, 3 Dec 2006 03:59:19 GMT
|
Viewed:
|
2308 times
|
| |
| |
So I found another use for my 2nd NXT, so that meant my R/C NXT Trike
(http://mindstorms.lego.com/nxtlog/ProjectDisplay.aspx?id=9c1f49e8-1c91-46bd-a35d-606e972fc95b)
needed a new way to be controlled. I decided maybe it was finally time to try
out the NXT playstation 2 wireless controller thingy I got from the
Mindsensors.com guys at Brickfest '06.
Step #1 buy a PS2 controller... check
Step #2 download & program in Robot C... as Homer Simpson would say, "D'oh!"
I was really struggling here. I'm no programmer, and I have to look at LOTS of
code examples before I understand what is going on. I got Robot C to work, and
managed to get the demo program to work, but just couldn't figure out how to get
the values from the PS controller and translate them into motor commands. Then,
to top it all off, the version of Robot C I JUST downloaded, quit working saying
the registration had expired!!! Now what? I knew there was no what I was going
to tackle NBC, so I was sunk.
Then I rememberd that the HiTechnic digital compass sensor returned SOME usable
values in NXT-G if set up as an ultrasonic sensor. Could the same thing be done
with the PSP-Nx? I deiced what was the worst that could happen? Nothing
ventured nothing gained right? So I plugged in the controller, set it up as an
ultrasonic sensor and PRESTO, I got 9 individual values depending on what
direction I pressed on the PS analog control stick! I was in business! In
short order, I had full directional control, forward, backward, and turns in
both directions! It isn't proportional, control is either forward, backward, or
off, and steering is either right, left, or straight, but it works!
I've been driving this around my house for the past hour, and it is working
beautifully. I understand that someone out there is working on a custom block
for NXT-G to work with the PSP-Nx. I can't wait for that, but until then, this
works.
I just had to share my programming success story, since they are so very few and
far between!
John
|
|
Message has 1 Reply: | | Re: score one for half a$$-ed programming
|
| (...) That is excellent! As you seem to be discovering, great programs are created one lucky hack at a time. Although persistence doesn't always pay off, it is a necessary ingredient in any worthwhile project. I am expecting UPS to deliver my first (...) (18 years ago, 3-Dec-06, to lugnet.org.us.laflrc)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|