View Single Post
  #11   Spotlight this post!  
Unread 16-10-2004, 14:52
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: Create a low speed drive in programming

Or perhaps have it divide the difference from 127 in half, add/subtract them and send that to PWMs

Like if your joystick is at 250

250 - 127 = 123 / 2 = 61.5 + 127 = 188.5

Code:
int DriveLimiter(int joyvalue)
{
	if(joyvalue > 127)
	{
		return ((joyvalue - 127) / 2) + 127;
	}
	if(joyvalue < 127)
	{
		return 127 - ((127 - joyvalue) / 2);
	}
}
I just did that off top of my head, don't shoot me if it's wrong, but that's the general idea. I think.
__________________
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!)