|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
How do you modify the Default Code from one joystick to two joysticks ![]() |
|
#2
|
|||||
|
|||||
|
Re: Modifying Default code
Quote:
Code:
//pwm13 = pwm14 = Limit_Mix(2000... //pwm15 = pwm16 = Limit_Mix(2000... Code:
/*------------ 2 Joystick -----------------*/ pwm13 = pwm15 = p1_y; pwm14 = pwm16 = 254 - p2_y; // Assumes your motors are reversed, just p2_y if not Last edited by Mark McLeod : 15-02-2004 at 12:46. |
|
#3
|
||||
|
||||
|
Re: Modifying Default code
Basically what he said, just simplified. To map two joysticks, you would do something like this:
Code:
// This code assumes the joystick are on ports 1 and 2 and pwm01 and 02 are the drive motors. // These can be easily changed pwm01 = p1_y; pwm02 = p2_y; |
|
#4
|
||||||
|
||||||
|
Re: Modifying Default code
The default code already has two joystick drive on pwm01 and pwm02. You just need to change pwms. No code changes necessary.
|
|
#5
|
|||||
|
|||||
|
Re: Modifying Default code
Quote:
IFI dropped the 2-joystick code from later versions. |
|
#6
|
||||||
|
||||||
|
Re: Modifying Default code
Quote:
Lines 211 and 212 (in Default_Routine) Code:
pwm01 = p1_y; pwm02 = p2_y; |
|
#7
|
|||||
|
|||||
|
Re: Modifying Default code
Quote:
I believe at one time (maybe EDU code) they had the line: Code:
/*---------- 2 Joystick Drive ---------------------------------------------- *------------------------------------------------------------------------- */ and that's what I was missing. Thanks! |
|
#8
|
||||
|
||||
|
Re: Modifying Default code
Quote:
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| default code and the actual robot | tml240 | Programming | 15 | 24-01-2004 11:31 |
| How long does it take you to load the default code? | vegasmcse | Robotics Education and Curriculum | 10 | 03-11-2003 21:41 |
| 2003 PBasic default code from Innovation First | ttedrow | Programming | 0 | 06-01-2003 11:18 |
| default code | archiver | 2001 | 2 | 23-06-2002 22:53 |
| Rookie Programmer has question about the default code | DanL | Programming | 3 | 26-01-2002 19:59 |