|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Custom Joystick Setup in easyC
Last year I developed a "Halo drive" control system for the robot in MPLab, which we plan to use again this year. The only problem is, since this is my senior year, I need to train some younger members to program, which will be done in easyC. Last year I completely avoided easyC because I didn't want to take the time to learn a new program. So this year I'm kinda screwed.
So anyway, I don't have the code I made up last year on me right now, as it's on my other laptop, but I was just wondering if there's any way to set up a control scheme that's not Arcade or Tank drive. If it helps, I had the controllers set up so that the wheels moved forward/back via input from the left joystick Y-axis, and moved left/right via the right joystick X-axis. Thanks |
|
#2
|
||||
|
||||
|
Re: Custom Joystick Setup in easyC
Yes, you can use OIToPWM() for direct drive or use GetOIAInput() with SetPWM() and make adjustments.
Code:
void OIToPWM(port, axis, pwm, direction) port - the joystick's port on the OI pwm - pwm output port number axis - 1 = x, 2 = y, 3 = wheel, 4 = aux direction - 0 = normal, 1 = invert unsigned char GetOIAInput(port, axis) port - the joystick's port on the OI axis - 1 = x, 2 = y, 3 = wheel, 4 = aux void SetPWM(pwm, value) pwm - pwm output port number value - the value to set it at |
|
#3
|
||||
|
||||
|
Re: Custom Joystick Setup in easyC
Check this out: http://www.chiefdelphi.com/forums/at...8&d=1165872883
It has examples of exactly what you want to do. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CMU CAM setup | stephenthe1 | Programming | 0 | 17-01-2006 11:36 |
| CMUcam setup | Ryan Collings | Programming | 26 | 13-01-2006 01:00 |
| Kickoff easyC workshop integrated into EasyC help file | Dan Larochelle | Programming | 0 | 11-01-2006 06:12 |
| EasyC v. 2.0 - New features, custom user functions, and more! | artdutra04 | FIRST Tech Challenge | 1 | 02-11-2005 13:36 |
| Favorite Joystick Setup? We're new | eatthafoodtina | Control System | 22 | 29-01-2005 18:14 |