Documentation
Pluto-IDE & MagisV2 SDK
Pluto-IDE & MagisV2 API Reference
RC Interface
Code with Pluto-IDE
Pluto-IDE is the professional development environment required to build, flash, and monitor firmware using the MagisV2 library on Pluto Drones.
RC-Interface.h
Remote control interface for processing RC commands and application data.
Enumerations
rc_channel_e
typedef enum {
RC_ROLL, // Roll channel
RC_PITCH, // Pitch channel
RC_YAW, // Yaw channel
RC_THROTTLE, // Throttle channel
RC_AUX1, // Auxiliary channel 1
RC_AUX2, // Auxiliary channel 2
RC_AUX3, // Auxiliary channel 3
RC_AUX4, // Auxiliary channel 4
RC_USER1, // User-defined channel 1
RC_USER2, // User-defined channel 2
RC_USER3 // User-defined channel 3
} rc_channel_e;
Functions
RC Data Functions
int16_t *RcData_Get(void)- Get pointer to RC data arrayint16_t RcData_Get(rc_channel_e CHANNEL)- Get raw RC value (1000-2000)
RC Command Functions
int16_t *RcCommand_Get(void)- Get pointer to RC command arrayint16_t RcCommand_Get(rc_channel_e CHANNEL)- Get processed command (offset from 1500)void RcCommand_Set(int16_t *rcValueArray)- Set commands from arrayvoid RcCommand_Set(rc_channel_e CHANNEL, int16_t rcValue)- Set specific channel
Application Functions
int16_t App_getAppHeading(void)- Get current heading in degreesbool App_isArmSwitchOn(void)- Check if arm switch is active
Usage Example
// Read RC values
int16_t rollValue = RcData_Get(RC_ROLL);
int16_t pitchValue = RcData_Get(RC_PITCH);
int16_t throttleValue = RcData_Get(RC_THROTTLE);
// Get processed commands (centered around 0)
int16_t rollCmd = RcCommand_Get(RC_ROLL); // -500 to +500
int16_t pitchCmd = RcCommand_Get(RC_PITCH); // -500 to +500
// Set custom RC values
int16_t customRC[4] = {1600, 1400, 1500, 1300};
RcCommand_Set(customRC);
// Individual channel control
RcCommand_Set(RC_ROLL, 1600); // Roll right
RcCommand_Set(RC_PITCH, 1400); // Pitch forward
// Check arm switch and heading
if (App_isArmSwitchOn()) {
int16_t heading = App_getAppHeading();
Monitor_Print("Armed, heading: ", heading);
}
