Go to Post ah, common sense, not as common as one might think... - Ansem Retort [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #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.
  #2   Spotlight this post!  
Unread 10-12-2006, 12:00
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,363
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
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   Spotlight this post!  
Unread 10-12-2006, 13:07
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Question about programing the bumper sensors

Quote:
Originally Posted by Kingofl337 View Post
We don't give you access to interrupts in easyC V2 for vex because we don't people stalling the microprocessor.
That's probably a good decision for somthing named "easyC", though I usually prefer to follow a different philosophy:

"UNIX was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things." – Doug Gwyn
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 01:27.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi