Pluto-IDE is the professional development environment required to build, flash, and monitor firmware using the MagisV2 library on Pluto Drones.
Bidirectional motor control interface for drone motor management.
motor_direction_etypedef enum motor_direction {
CLOCK_WISE = 0, // Clockwise rotation
ANTICLOCK_WISE // Counter-clockwise rotation
} motor_direction_e;
bidirectional_motor_etypedef enum bidirectional_motor {
M1, // Motor 1
M2, // Motor 2
M5, // Motor 5
M6, // Motor 6
M7, // Motor 7
M8 // Motor 8
} bidirectional_motor_e;
bool usingMotorAPI - Flag indicating motor API usagevoid Motor_Init(bidirectional_motor_e _motor)Initializes specified motor for bidirectional control.
Parameters:
_motor - Motor to initializevoid Motor_Set(bidirectional_motor_e _motor, int16_t pwmValue)Sets PWM value for specified motor.
Parameters:
_motor - Motor to controlpwmValue - PWM value (positive/negative for direction, magnitude for speed)void Motor_SetDir(bidirectional_motor_e motor, motor_direction_e direction)Sets rotation direction for specified motor.
Parameters:
motor - Motor to controldirection - Rotation direction (CLOCK_WISE or ANTICLOCK_WISE)// Initialize motors
Motor_Init(M1);
Motor_Init(M2);
Motor_Init(M5);
Motor_Init(M6);
// Set directions
Motor_SetDir(M1, CLOCK_WISE);
Motor_SetDir(M2, ANTICLOCK_WISE);
// Set motor speeds
Motor_Set(M1, 1200); // Forward at medium speed
Motor_Set(M2, -800); // Reverse at low speed
Motor_Set(M5, 0); // Stop motor
Motor_Set(M6, 1500); // Forward at high speed
// Gradual speed increase
for (int speed = 0; speed <= 1500; speed += 100) {
Motor_Set(M1, speed);
delay(100);
}
