To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 23864
23863  |  23865
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
  
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:
  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:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR