Quote:
|
Using MPLAB C you can run easily without the transmitter by having the code force autonomous operation.
|
As far as I know, you must have a transmitter turned on to trigger autonomus mode.
The way the field control works is turning the transmitter on and off to cycle through the robot "control states".
Quote:
|
I seem to recall that there are two set of "functions" for turning motors/servos on; and that one of them required the transmitter to be on and the other didn't?
|
There is an option on who is the controller of the motors:
Code:
/*******************************************************************************
* FUNCTION NAME: Setup_Who_Controls_Pwms
* PURPOSE: Each parameter specifies what processor will control the pwm.
*
* CALLED FROM: User_Initialization
* Argument Type IO Description
* -------- ---- -- -----------
* pwmSpec1 int I USER/MASTER (defined in ifi_aliases.h)
* pwmSpec2 int I USER/MASTER
* pwmSpec3 int I USER/MASTER
* pwmSpec4 int I USER/MASTER
* pwmSpec5 int I USER/MASTER
* pwmSpec6 int I USER/MASTER
* pwmSpec7 int I USER/MASTER
* pwmSpec8 int I USER/MASTER
* RETURNS: void
*******************************************************************************/
static void Setup_Who_Controls_Pwms(int pwmSpec1,int pwmSpec2,int pwmSpec3,int pwmSpec4,
int pwmSpec5,int pwmSpec6,int pwmSpec7,int pwmSpec8)
{
txdata.pwm_mask = 0xFF; /* Default to master controlling all PWMs. */
if (pwmSpec1 == USER) /* If User controls PWM1 then clear bit0. */
txdata.pwm_mask &= 0xFE; /* same as txdata.pwm_mask = txdata.pwm_mask & 0xFE; */
if (pwmSpec2 == USER) /* If User controls PWM2 then clear bit1. */
txdata.pwm_mask &= 0xFD;
if (pwmSpec3 == USER) /* If User controls PWM3 then clear bit2. */
txdata.pwm_mask &= 0xFB;
if (pwmSpec4 == USER) /* If User controls PWM4 then clear bit3. */
txdata.pwm_mask &= 0xF7;
if (pwmSpec5 == USER) /* If User controls PWM5 then clear bit4. */
txdata.pwm_mask &= 0xEF;
if (pwmSpec6 == USER) /* If User controls PWM6 then clear bit5. */
txdata.pwm_mask &= 0xDF;
if (pwmSpec7 == USER) /* If User controls PWM7 then clear bit6. */
txdata.pwm_mask &= 0xBF;
if (pwmSpec8 == USER) /* If User controls PWM8 then clear bit7. */
txdata.pwm_mask &= 0x7F;
/*******************************************************************************
* FUNCTION NAME: User_Initialization
* PURPOSE: This routine is called first (and only once) in the Main function.
* You may modify and add to this function.
* The primary purpose is to set up the DIGITAL IN/OUT - ANALOG IN
* pins as analog inputs, digital inputs, and digital outputs.
* CALLED FROM: main.c
* ARGUMENTS: none
* RETURNS: void
*******************************************************************************/
void User_Initialization (void)
<..... snip about 25 lines ...>
/* SEVENTH: Choose which processor will control which PWM outputs. */
Setup_Who_Controls_Pwms(MASTER,MASTER,MASTER,MASTER,MASTER,MASTER,MASTER,MASTER);
/* EIGHTH: Set your PWM output type. Only applies if USER controls PWM 1, 2, 3, or 4. */
/* Choose from these parameters for PWM 1-4 respectively: */
/* IFI_PWM - Standard IFI PWM output generated with Generate_Pwms(...) */
/* USER_CCP - User can use PWM pin as digital I/O or CCP pin. */
Setup_PWM_Output_Type(IFI_PWM,IFI_PWM,IFI_PWM,IFI_PWM);
}
But I think that's the PWM pulse timing, not if the motor drive is enabled. It's making changes in the Tdata structure. Maybe someone from IFI can add some light, but as far as I know the transmitter needs to be on to enable the motors to move.