Subject:
|
Re: Spybotics To RCX Comm
|
Newsgroups:
|
lugnet.robotics.spybotics
|
Date:
|
Thu, 29 Aug 2002 20:21:39 GMT
|
Viewed:
|
5347 times
|
| |
| |
That's what I was missing.
I can build/convert a Spybot with a down-pointing light sensor & LED (I had one, but couldn't get it working)
Thanks
Steve
----- Original Message -----
From: "John Hansen" <JohnBinder@aol.com>
Date: Thu, 29 Aug 2002 20:03:36 GMT
To: lugnet.robotics.spybotics@lugnet.com
Subject: Re: Spybotics To RCX Comm
In lugnet.robotics.spybotics, Steve Hassenplug writes:
> Yes, I use NQC and BricxCC to program it. It's very simple, and I just set motor port C to forward
That is not the way to simply turn on the laser LED. When you set motor C
to forward the LED will commence sending VLL motor forward commands out the
LED which, of course, will result in a flickering LED.
The Scout worked the same way - the LED would flicker because it was sending
a pattern of flashing lights that a VLL receiver would interpret as a motor
command.
With NQC just use:
SetLight(LIGHT_ON);
or
LED(LED_MODE_ON);
Here's a modified version of 5_light.nqc. Using two light pipes that are
held close together at the far end (and pointed directly at the ground about
a 1/4 inch above the ground) I am able to detect the presence of a dark
stripe on a light surface. I used a technic cam to hold the ends of the
light pipes with a simple frame extending from the rear of the spybot to
hold everything in the correct position. Can someone work up a "good"
structure for this? Mine is definitely just a quick and dirty hack.
// 5_spy_light.nqc
#define THRESHOLD 40
task main()
{
SetLight(LIGHT_ON);
SetSensorMode(SENSOR_2, SENSOR_MODE_PERCENT);
OnFwd(OUT_A+OUT_B);
while (true)
{
if (SENSOR_2 > THRESHOLD)
{
OnRev(OUT_B);
Wait(10);
until (SENSOR_2 <= THRESHOLD);
OnFwd(OUT_A+OUT_B);
}
}
}
John Hansen
--
_______________________________________________
Talk More, Pay Less with Net2Phone Direct(R), up to 1500 minutes free!
http://www.net2phone.com/cgi-bin/link.cgi?143
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|