Go to Post We're all such geeks...not that's that a bad thing. - IMDWalrus [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 08-02-2006, 14:16
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Where is tank drive in 2005 code?

Be careful, it's very easy to accidentally make it multiply by 0, the PIC has no dedicated floating point processor and does weird things to decimals. It would make your motors constantly run full reverse. Which is also bad

I recommend multiplying up then dividing down. For example instead of

Code:
pwm01 = p1_y * 0.2; //Error Prone! BAD!
Use this

Code:
pwm01 = (unsigned int)(p1_y * 2) / 10;
Try them both on your calculator, you'll get the same result, but the PIC is more likely to work with the second method...practically guaranteed to work better than the first.

Good luck!
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
 


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
looking for 1 joystick Pbasic drive code Greg Needel Programming 8 02-09-2005 20:35
pic: Team 836 2005 Drive Plate Bcahn836 Robot Showcase 11 09-02-2005 10:13
2005 default code won't compile Robby Programming 22 04-02-2005 18:21
Sourceforge for Code Repository and other stuff SilverStar Programming 9 15-01-2005 21:16
Recovering code from the RC Orborde Programming 15 04-12-2004 20:02


All times are GMT -5. The time now is 21:53.

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