|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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. Last edited by Kingofl337 : 10-12-2006 at 08:41. |
|
#2
|
|||
|
|||
|
Re: Question about programing the bumper sensors
Also, remember that no matter how fast the loop is or how fast you catch an interrupt, the user to master proc communications only happen on a tens of ms scale. This means that you can only affect a change to a vector every 10 - 20 ms. I forget the timing of the master interrupt in easy-c. I think it's different than the Mplab default code.
|
|
#3
|
|||||
|
|||||
|
Re: Question about programing the bumper sensors
Quote:
"UNIX was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things." – Doug Gwyn |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bumper sensors | jbill30 | Programming | 1 | 01-05-2006 18:49 |
| Quick question about sensors..plz help thnx | pheNIX637 | Technical Discussion | 6 | 30-10-2005 02:52 |
| Bumper sensors | jeffmorris | FIRST Tech Challenge | 1 | 02-10-2005 16:20 |
| question on the pressure pad sensors | Simon Strauss | Rules/Strategy | 5 | 08-01-2005 23:42 |
| question about one joystick drive programing | james700 | Programming | 13 | 29-01-2003 14:49 |