|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Hello. Does the FRC default code allow 2 joysticks to be used? Also, is there any way to adjust the sensitivity of the controllers, or the speed of the motors?
|
|
#2
|
||||
|
||||
|
Re: Joystick Programming
Hi, and yes there is. The controllers (I'm going to guess that you mean the Victors) are pretty much un-programmable. The motors, however, are programmable by way of the Victors that run them. Now I'm not sure what you are using for the programming tool but we used the free ROBOTC software that can be downloaded from one of these forums(try searching FREE ROBOTC, that's what I did). Let me know if it's a different programming language and I'll help you. You could also PM me if you need any more help.
![]() |
|
#3
|
||||
|
||||
|
Re: Joystick Programming
also, if you're new at this and dont have anyone else who knows what they're doing, avoid using MPLab....try EasyC or robotC instead. i dont have any experience with these, but they're supposed to be easier!
|
|
#4
|
||||
|
||||
|
Re: Joystick Programming
I concur ROBOTC and EasyC are probably the easiest.
|
|
#5
|
||||
|
||||
|
Re: Joystick Programming
i just avoid them because they have 'easy' in them (well, just easyC)
![]() |
|
#6
|
|||
|
|||
|
Re: Joystick Programming
I'm sorry, I should have been a bit clearer: By controllers, I meant the joysticks.
Where in the code does it allow you to adjust motor sensitivity? Looking at the default code, I have no idea where I can adjust that. |
|
#7
|
||||
|
||||
|
Re: Joystick Programming
if you look in the default code you will see lines like
Code:
pwm01 = p1_y pwm02 = p2_y I will give you a link to a thread I posted in a couple of weeks ago on this. Edit: http://www.chiefdelphi.com/forums/sh...ad.php?t=61929 |
|
#8
|
||||
|
||||
|
Re: Joystick Programming
I'm sorry what programming tool are you using? That code that wt200999 posted may be the code that works for EasyC only (i don't know really). There are other codes that work with other systems.
|
|
#9
|
||||
|
||||
|
Re: Joystick Programming
Sorry about any confusion, that thread was about how to do it in easyC, the example I posted in there I wrote in MPlab. Someone else had posted code in that thread that works in easyC if you are using that.
Last edited by wt200999 : 29-01-2008 at 23:09. |
|
#10
|
|||
|
|||
|
Re: Joystick Programming
OK...thanks for the info.
I have another question: What kind of algorithm or math should I use to reduce joystick sensitivity? I am really new to this programming thing... |
|
#11
|
||||
|
||||
|
Re: Joystick Programming
Hi there.
ROBOTC makes using the joystick very easy. If you wanted to use the joysticks to drive your robot you could the following code: while(true){ motor[port1] = frcRF[p1_y]; //maps pwm port 1 to the Y axis of Joy1 motor[port2] = frcRF[p2_y]; //maps pwm port 2 to the Y axis of Joy2 { You can in exchange slow down the motors and still retain the joystick "movement" by dividing the values you're getting from the joystick... like in this example: while(true){ motor[port1] = (frcRF[p1_y] / 2); //maps pwm port 1 to half the value of the Y axis of Joy1 motor[port2] = (frcRF[p2_y] / 2); //maps pwm port 2 to half the value of the Y axis of Joy2 { |
|
#12
|
||||
|
||||
|
Re: Joystick Programming
I posted here about what we do. It gives us maximum speed (something dividing doesn't) and reduces sensitivity at low speeds. If you are using RobotC or EasyC, I don't know how you would implement it, but I assume that it is possible (I mean, if those tools don't allow working with arrays, I would be very disappointed).
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Joystick Programming | LieAfterLie | Programming | 7 | 15-02-2007 09:30 |
| Programming a Joystick | sbf2009 | Programming | 3 | 10-02-2007 15:59 |
| Joystick Programming | team 803 | Programming | 6 | 21-02-2006 11:49 |
| Joystick Button programming | Bharat Nain | Programming | 5 | 18-02-2005 11:48 |
| single joystick programming | Bill Bonsky | OCCRA | 2 | 04-10-2003 09:47 |