Subject:
|
why doesn't this work?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 30 Nov 2004 21:18:03 GMT
|
Viewed:
|
1000 times
|
| |
| |
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 their are no parrallel tasks running. why doesn't it work?
Steve
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;
}
|
|
Message has 1 Reply:
9 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|