Subject:
|
light sensor, 3 secs
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Mon, 11 Apr 2005 23:41:23 GMT
|
Original-From:
|
roc <principio@ilimit(spamcake).es>
|
Viewed:
|
1256 times
|
| |
![Post a public reply to this message](/news/icon-reply.gif) | |
i am working on this silly game where you have to "shoot" a simple
pivoting mechanism (it moves like a metronome) with a light sensor on
top of it, using a laser pointer. you win if you manage to keep the
laser pointer in the light sensor for more than, say, 3 seconds. so the
robot will try to avoid that and dodge the beam by moving randomly and
at different speeds. i am a NQC newbie and i cant figure out the way to
make the program check if the light sensor is "hit" for 3 seconds.
any help will be really appreciated.
|
|
Message has 1 Reply: ![](/news/x.gif) | | Re: light sensor, 3 secs
|
| You could base the program on a loop. The RCX has a built in timer - and you can read this in NQC - (URL) loop checks the state of the sensors, and how long they have been pressed. if the sensor is no longer active - go to a "loser" routine, and if (...) (20 years ago, 12-Apr-05, to lugnet.robotics)
|
2 Messages in This Thread: ![You are here](/news/here.gif) ![](/news/46.gif) ![Re: light sensor, 3 secs -Danny Staple (12-Apr-05 to lugnet.robotics)](/news/x.gif)
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|