#include "motor.h" #include "pwm.h" #include "inc/msp432p401r.h" // Initialize GPIO pins for output, which will be // used to control the direction of the motors and // to enable or disable the drivers. // The motors are initially stopped, the drivers // are initially powered down, and the PWM speed // control is uninitialized. void MotorInit(void) { // write this code } // Stop the motors, power down the drivers, and // set the PWM speed control to 0% duty cycle. void MotorStop(void) { P2->OUT &= ~0xC0; // off P3->OUT &= ~0xC0; // low current sleep mode SetPWMDutyLeftMotor(0); SetPWMDutyRightMotor(0); } // Left and right wheels forward with the given duty cycles. // Duty cycle is 0 to 14,998. void MotorForward(uint16_t left_duty, uint16_t right_duty) { // write this code } // Left and right wheels backward with the given duty cycles. // Duty cycle is 0 to 14,998. void MotorBackward(uint16_t left_duty, uint16_t right_duty) { // write this code } // Left wheel backward, right wheel forward with the given duty cycles. // Duty cycle is 0 to 14,998. void MotorLeft(uint16_t left_duty, uint16_t right_duty) { // write this code } // Left wheel forward, right wheel backward with the given duty cycles. // Duty cycle is 0 to 14,998. void MotorRight(uint16_t left_duty, uint16_t right_duty) { // write this code }