I. Awards
This work won the second prize in the Jiangxi Division of the 2024 National Undergraduate Electronic Design Contest.
II. Topic Requirements

III. Design Summary
This work adopts a modular design. The control board uses the LCSC development board MSPMOG3507 as the main controller, integrating common modules such as OLED display module, buttons, and buzzer; the power board uses two adjustable switching power supplies to step down the 12V power input to 10V and 5V, and uses a TB6612 motor driver to drive two MG310 motors; the tracking board simply places two rows of corner headers, and infrared tracking or grayscale sensors can be freely added as needed.
IV. Physical Demonstration




V. Precautions
For better results, an external Witt serial port gyroscope was also connected.
VI. Demonstration Video
See the attached video for the demonstration video.
VII. Code
The software part of this project was developed using the CCS Theia platform. The program was burned using the Type-C port on the Dimengxing development board. The burning tool was UniFlash.
Part of the code is given below; the complete code is in the attached file. Car_v4.1
{
SYSCFG_DL_init(); // Chip initialization
DL_TimerG_startCounter(Motor_PWM_INST); // Motor PWM enable
NVIC_EnableIRQ(TIMER_Encoder_Read_INST_INT_IRQN); // Encoder timer enable NVIC_EnableIRQ(
GPIO_MULTIPLE_GPIOA_INT_IRQN); // GPIOA interrupt enable
DL_Timer_startCounter(TIMER_Encoder_Read_INST); // Start encoder timer
NVIC_ClearPendingIRQ(UART_0_INST_INT_IRQN); // Clear UART0 interrupt flag
NVIC_EnableIRQ(UART_0_INST_INT_IRQN); // Enable UART0 interrupt
NVIC_ClearPendingIRQ(UART_1_INST_INT_IRQN); // Clear UART1 interrupt flag
NVIC_EnableIRQ(UART_1_INST_INT_IRQN); // Enable UART1 interrupt
NVIC_EnableIRQ(ADC12_1_INST_INT_IRQN); // Enable ADC interrupt
OLED_Init(); // Hardware I2C-OLED initialization
OLED_Clear(); // OLED screen clear
control_PID_Init(); // PID controller initialization
motor_Direction_Set(0,0); // Motor initialization
tracking_Init(); // Tracking initialization
/* Task system time initialization */
current_time = Get_Tick();
uint32_t last_task01_time = current_time;
uint32_t last_task02_time = current_time;
Mode = 0; //test
while (1)
{
control_Proc(); //main control process
display_Remind_Proc(); //audio-visual prompt process
com_UART0Receive_Handle(); //data processing after the UART0 data packet reception success flag is set
current_time = Get_Tick();
/*button process*/
if(current_time - last_task01_time >= TASK_BUTTON_DELAY)
{
// TODO Task01
last_task01_time = current_time;
button_Proc();
}
/*OLED process*/
if(current_time - last_task02_time >= TASK_OLED_DELAY)
{
// TODO Task02
last_task02_time = current_time;
display_OLED_Proc(display_OLED_mode);
}
}
}