View Single Post
  #2   Spotlight this post!  
Unread 05-05-2008, 20:38
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: HELP Arcade style program for first Robot

There's a couple ways to do it, you have to figure out which is most intuitive.

One example:
Code:
DRIVE_L = (int) STICK_Y + ((int) STICK_X - 127);
DRIVE_R = (int) STICK_Y - ((int) STICK_X - 127);
DRIVE_L = (DRIVE_L<0)?(0):((DRIVE_L>254)?(254):(DRIVE_L));
DRIVE_R = (DRIVE_R<0)?(0):((DRIVE_R>254)?(254):(DRIVE_R));