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 / 23080
23079  |  23081
Subject: 
Re: why doesn't this work?
Newsgroups: 
lugnet.robotics
Date: 
Tue, 30 Nov 2004 21:32:02 GMT
Viewed: 
832 times
  
void init()
       {
       OnFwd(OUT_A);
       Wait(150);
       Float(OUT_A);
       int oldsensor=SENSOR_1;
       int temp;

       int inc=0;
       while(timeout<2000)
          {
          temp =  SENSOR_1;
          if(temp != oldsensor)
             {
             if(inc<27){array[inc] = timeout;
             }
             timeout=0;
             inc=inc+1;
             oldsensor=temp;
             }
          else
             {timeout++;}
          }
          start checkvar;
       }

What is the value of inc when you're done?

And, is SENSOR_1 defined as a rotation sensor?  (and active?)

Steve



Message has 1 Reply:
  Re: why doesn't this work?
 
(...) 2000 (...) Yes (it shows up fine on the watch graph) Steve here's the whole program #define TRUE 1 #define FALSE 0 int Vvariable; int Aforward=1; int speed; int maxspeed=0; int timeout=0; int array[27]; task main() { //start speedcontrol; (...) (19 years ago, 30-Nov-04, to lugnet.robotics)

Message is in Reply To:
  why doesn't this work?
 
I've written a program to record the timing of a rotation sensor changing in an array, but all I get out is zero's and the occaisonal 1 or 4. I've checked several things but can't find any obvious problem. The program compiles and runs perfectly and (...) (19 years ago, 30-Nov-04, to lugnet.robotics)

9 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
    

Custom Search

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