To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.org.ca.rtltorontoOpen lugnet.org.ca.rtltoronto in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Organizations / Canada / rtlToronto / 11650
11649  |  11651
Subject: 
Re: NQC problem...driving me insane!
Newsgroups: 
lugnet.robotics.rcx.nqc, lugnet.org.ca.rtltoronto
Date: 
Mon, 5 Jul 2004 04:01:15 GMT
Viewed: 
8 times
  
In lugnet.robotics.rcx.nqc, Iain Hendry wrote:

int threshold;
task main()
{
  SetSensorType(SENSOR_1, SENSOR_TYPE_LIGHT);
  OnFwd(OUT_A);
  threshold=SENSOR_1;
  until(SENSOR_1<threshold-5);
  Off(OUT_A);
}



You should check to make sure your light sensor is in fact changing more than 5
counts.  Start by changing the above code to 2 or 3.

I don't recall with NQC, but with some languages (BrickOS) the values are
backwards, so you may need to check for SENSOR_1>threshold+5.

Another quick test is to try a different light sensor.

Steve



Message is in Reply To:
  NQC problem...driving me insane!
 
Hey all, I know I must be doing something very simple wrong here - but I can't for the life of me figure it out. What I'm trying to do: Have a light sensor pointed at a surface. Pass that value off to a variable (the variable then contains the (...) (20 years ago, 4-Jul-04, to lugnet.robotics.rcx.nqc, lugnet.org.ca.rtltoronto)

3 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