View Single Post
  #1   Spotlight this post!  
Unread 10-12-2006, 08:38
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Question about programing the bumper sensors

easyC doesn't have a fast loop and a slow loop. Instead you program executes as fast as the processor can run it. Using a button on a interupt probably wouldn't get you anywhere.

When you do this:

while(counter<=50) //while the robot is driving backwards
{
Get_Bumper_Data(Back_Bumper_Port) /*puts the data from the back bumper into a global varaible named Back_Bumper_Data*/

if(Back_Bumper_Data==0) //if back bumper is pressed
{
break;
}

The code is probably looping in less then a ms.

Things to remeber when you write any code with high accuracy. MPLAB or EasyC Printing to screen kills your loop speed.
I don't know the size of rest of your code but as long as you don't have any prints or waits its probably cycling very fast. < 10ms

Lasty I think I would use a timer instead of a counter and keep reseting it.

We don't give you access to interrupts in easyC V2 for vex because we don't people stalling the microprocessor.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 10-12-2006 at 08:41.