To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 1189
1188  |  1190
Subject: 
Re: Help needed for an NQC newbie
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Wed, 8 Aug 2001 01:37:40 GMT
Viewed: 
5176 times
  
Thanks a lot. I added the while statement and it worked. As far as the value
of the light sensor, I kept the value I had and it worked correctly. I will
post pictures of the setup after the weekend and you will understand.

Jude

Thanks again for the help

In lugnet.robotics.rcx.nqc, Robert Fay writes:
> Try this. I had to change the value of the light sensor and add a While
> (true) statement.
> 
> task main()
> {
> SetSensor(SENSOR_3,SENSOR_ROTATION);
> ClearSensor(SENSOR_3);
> SetSensor(SENSOR_2,SENSOR_LIGHT);
> SetPower(OUT_A,2);
> while (true)
> if (SENSOR_2<40)
> {
>  OnFwd(OUT_A+OUT_B);
>  until (SENSOR_3>=4);
>  Off(OUT_A);
>  Wait(100);
>  until (SENSOR_2>=32);
>  Wait(100);
>  until (SENSOR_2>=32);
>  OnRev(OUT_A);
>  until (SENSOR_3<1);
>  Off(OUT_A);
> StopAllTasks();
> }
> }
> 
> 
> --
> Bob Fay
> rfay@we.mediaone.net
> 
> http://bobfay.50megs.com/index.html
> http://www.geocities.com/Heartland/Bluffs/7900/

<snip>



Message is in Reply To:
  Re: Help needed for an NQC newbie
 
Try this. I had to change the value of the light sensor and add a While (true) statement. task main() { SetSensor(SENSOR_3,S...ROTATION); ClearSensor(SENSOR_3); SetSensor(SENSOR_2,S...OR_LIGHT); SetPower(OUT_A,2); while (true) if (SENSOR_2<40) { (...) (25 years ago, 8-Aug-01, to lugnet.robotics.rcx.nqc)

4 Messages in This Thread:


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

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