|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
[FVC]: MPLab using two transmitters
Okay, I looked and looked and can't find example code to do the following: One transmitter drives the bot. The other transmitter handles the arm and servos. I see how to do it with EasyC, but how do you do it in MPLab. Do I have access to two RxData/TxData data structures. Where?
Quote:
Mannie Lowe |
|
#2
|
|||||
|
|||||
|
Re: [FVC]: MPLab using two transmitters
PWM_in1 through 6 are from the first Vex receiver port
PWM_in7 through 12 are from the second Vex receiver port. So... Code:
// Driver Control - Rx1 preferably pwm03 = PWM_in1; // Depends on what mode you select on the transmitter pwm04 = PWM_in2; //Arm Control - Rx2 preferably pwm01 = PWM_in7; //- Arm raise/lower (on CH 1 of 2nd transmitter) pwm02 = PWM_in9; //- Arm extend/retract (on CH 3 of 2nd transmitter) pwm05 = PWM_in11; //- Servo to lock arm (on CH 5 of 2nd transmitter) Code:
/* *------------------------------------------------------------------------------- *---------- Aliases for R/C PWM IN connectors ------------------------------- *------------------------------------------------------------------------------- * Below are aliases for the PWM inputs received from the radio-control receiver. */ #define PWM_in1 rxdata.oi_analog01 #define PWM_in2 rxdata.oi_analog02 #define PWM_in3 rxdata.oi_analog03 #define PWM_in4 rxdata.oi_analog04 #define PWM_in5 rxdata.oi_analog05 #define PWM_in6 rxdata.oi_analog06 #define PWM_in7 rxdata.oi_analog07 #define PWM_in8 rxdata.oi_analog08 #define PWM_in9 rxdata.oi_analog09 #define PWM_in10 rxdata.oi_analog10 #define PWM_in11 rxdata.oi_analog11 #define PWM_in12 rxdata.oi_analog12 Last edited by Mark McLeod : 23-02-2007 at 16:05. |
|
#3
|
|||||
|
|||||
|
Re: [FVC]: MPLab using two transmitters
Mark:
Thank you. Thank you. I knew that. I just had a brain freeze these past three days trying to get ready for the tournament that I'm running on 2/24 (Georgia FVC) and mentoring my team at the same time. I coded it right after I got your reply and it worked like a charm. Chimera #832 thanks you very much. Mannie |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using MPLAB SIM | koenig3456 | Programming | 5 | 11-02-2008 14:39 |
| Teams using MPLAB | Ctrl Alt Delete | FIRST Tech Challenge | 4 | 22-09-2006 22:37 |
| Problem using two transmitters | jamesgecko | FIRST Tech Challenge | 9 | 12-05-2005 09:30 |
| using the MPLAB IDE MPLAB SIM simulator | WizardOfAz | Programming | 1 | 03-11-2003 01:24 |
| Using two Large PAPST Fans? | SuperDave | Electrical | 9 | 17-02-2003 15:11 |