Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   EDU robot programming (http://www.chiefdelphi.com/forums/showthread.php?t=23037)

AlphaOmega870 10-12-2003 07:02

EDU robot programming
 
How would I go about changing the default program from single joy stick control to two joy stick control? :confused:

Mark McLeod 10-12-2003 09:15

Re: EDU robot programming
 
Quote:

Originally Posted by AlphaOmega870
How would I go about changing the default program from single joy stick control to two joy stick control? :confused:

In 1-joystick drive the code mixes the x/y on the one joystick. For 2-joystick drive you just use the y axis on each of 2 joysticks.

Change the following lines in user_routines.c at the top of Default_Routine to get rid of the mixed result and just use the PWM inputs directly.

Original code (get rid of the mixing):
pwm01 = pwm03 = Limit_Mix(2000 + PWM_in1 + PWM_in2 - 127); /* LEFT WHEELS */
pwm02 = pwm04 = Limit_Mix(2000 + PWM_in2 - PWM_in1 + 127); /* RIGHT WHEELS */
pwm01 = pwm03 = 255 - pwm01; /* reverse direction of left side */

New code (just :
pwm01 = pwm03 = 255 - PWM_in2; /* LEFT WHEELS - reverse direction of left side */
pwm02 = pwm04 = PWM_in4; /* RIGHT WHEELS */


All times are GMT -5. The time now is 00:28.

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