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 / 404
403  |  405
Subject: 
Help with rotation sensors
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Sun, 23 Jan 2000 16:32:06 GMT
Viewed: 
1553 times
  
Hi all,

I'm new to programing so this may seem like a silly question.

I'm using two rotation sensors with the program below to eliminate drift
caused by different motor speeds. Is it possible to break this loop when a
certain distance is reached? I don't want to use another rotation sensor.

while (true)
{
  if (SENSOR_1 > SENSOR_3)
  {
    Float(OUT_A);
  }
  else if (SENSOR_3 > SENSOR_1)
  {
    Float(OUT_C);
  }
  else
  {
    OnFwd(OUT_A+OUT_C);
  }

Thanks,

Steve.



Message has 1 Reply:
  Re: Help with rotation sensors
 
(...) You could probably change the first line to while (SENSOR_1 < target_distance) and it should work fine. Since you want to keep the two rotation sensor values (and hence the two wheel distances) equal, each sensor will individually measure the (...) (24 years ago, 24-Jan-00, to lugnet.robotics.rcx.nqc)

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