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 / 26954
26953  |  26955
Subject: 
Re: TachoSpeed.nqc
Newsgroups: 
lugnet.robotics
Date: 
Tue, 13 Mar 2007 13:26:09 GMT
Viewed: 
3875 times
  
task main()
     {
     OnFwd (OUT_L+OUT_R);
     Wait (20);
     while (true)
          {
          if (TachoSpeed(OUT_R) < threshold) //default behaviour
             {
             reverse (50);
             clockwise (30);
             OnFwd (OUT_L+OUT_R);
             Wait (20);
             }
          if (TachoSpeed(OUT_L) < threshold) // alternate behaviour
             {
             reverse (50);
             c_clockwise (30);
             OnFwd (OUT_L+OUT_R);
             Wait (20);
             }
          }
     }

That doesn't solve the riddle though, because I hade the bot pushing
against the wall for several seconds, with 'watching the brick'
reporting values of around 57 and still the if statement wasn't executed.

For the RCX wait times are in 1/100 of a second.  Is that the same for the
Cybermaster?  If so the reverse and turn times are a little short (as well as
the motor ramp up period).  I could see how it would be difficult to notice the
robot backup for 1/2 a second and then turn for 3/10 of a second.  It may just
look like the robot is always driving forward.

Can Cybermaster make sounds?  I use sound on the RCX for debugging purposes all
the time.



Message has 1 Reply:
  Re: TachoSpeed.nqc
 
(...) According to the NQC Programmer's Guide the Cybermaster wait time is in 1/10 seconds. This is consistent with my CyberMaster's behaviour when I set the threshold to a high value and the if routine is executed. I hadn't considered using sounds (...) (18 years ago, 13-Mar-07, to lugnet.robotics)

Message is in Reply To:
  Re: TachoSpeed.nqc
 
(...) You assumed correctly. Without the wait the if statement is always executed immediately. I see what you mean: by taking the wait out of the start of the loop the sensors are checked more frequently. That doesn't solve the riddle though, (...) (18 years ago, 12-Mar-07, to lugnet.robotics)

13 Messages in This Thread:



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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
7 hours ago
Custom Search

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