Recently, I was working on a simple small project , use stm32 Make an intelligent car , I use it 32 The plate is a punctual atom stm32mini of . In the future, I will continue to update the project dynamics and actively share experiences and procedures with you .

This is the preliminary of the car —— motor drive

My car parallels a row of motors on the left , Parallel the motors on the right , It will be more convenient and simple to find a parallel motor .

First, the motor drive module uses L9110 This module ,L9110 It is simple to drive a DC motor , Output equals supply voltage .

For the trolley motor PWM Aspects are quite simple .
I use a timer 3 Channel for 1 And channels 3, set up TIM3_CH1 and TIM3_CH3 of PWM pattern .

Because I started driving with a timer TIM1 It's complicated , Configuration is not easy .

also keil5 Compiler solid library is not very clear , I suggest that you configure the motor at high and low levels , Do not install the .c Direct macro definition in file , System disapproval .

It is better to define the driver function directly in the main function .

And I made a mistake Undefined symbol time (referred from dianji.o).

program :
void ahead(void)// Define forward function { A1=1; A2=0; B1=1; B2=0; } void back(void)// Define fallback function {
A1=0; A2=1; B1=0; B2=1; } void STOP(void)// Define stop function { A1=0; A2=0; B1=1; B2=1; }
void right(void)// Define right turn function { A1=1; A2=0; B1=1; B2=1; } void left(void)// Define left turn function {
A1=0; A2=0; B1=1; B2=0; } int main(void) { system_Clock_Init(); // System clock setting
uart_init(115200); // Serial port is initialized to 115200 delay_init(); // Delay initialization TIM3_PWM_Init();
dianji_Init(); while(1) { ahead(); } }

©2019-2020 Toolsou All rights reserved,
Solve in servlet The Chinese output in is a question mark C String function and character function in language MySQL management 35 A small coup optimization Java performance —— Concise article Seven sorting algorithms (java code ) use Ansible Batch deployment SSH Password free login to remote host according to excel generate create Build table SQL sentence Spring Source code series ( sixteen )Spring merge BeanDefinition Principle of Virtual machine installation Linux course What are the common exception classes ?