更新日志Logs - HRex39/STM32_car GitHub Wiki
Logs
HCR 2021/6/10
-
Things about Delay:
eg.. delay_ms(1000)
-
Things about Infrared:
IF GPIO_ReadInputDataBit == 0
THEN there is the obstacle
eg..if (GPIO_ReadInputDataBit(GPIOA, Infra_Left) == 0) GPIO_ResetBits(GPIOC, LED1); else GPIO_SetBits(GPIOC, LED1);
-
Thing about Ultrasonic:
RCC_APB1PeriphClockCmd
: Enables or disables the Low Speed APB (APB1) peripheral clock.RCC_APB2PeriphClockCmd
: Enables or disables the High Speed APB (APB2) peripheral clock.
YSK 2021/6/11
-
You can just use following code to run the car:
- Next two should use with delay:
Go_Forward();delay_ms(1000); Go_Back();delay_ms(1000);
- Others just easily use it:
Car_Stop(); Turn_Left(); Turn_Right(); Turn_Around();
- Next two should use with delay:
-
You can just use following code to test or use Infrared:
//Distance less than threshold will light the LED void LED_Check_Infrared(uint16_t GPIO_Pin); //Distance less than threshold return true, else return false bool Get_Infrared(uint16_t GPIO_Pin);
-
I move some test code to test() in test.h
YSK 2021/6/16
-
4个红外pin口的的定义,初始化时使用的是GPIOA。
- port.h line9
-
修正轨迹时的时间延迟(即修正的幅度)。
#define vertifyTime 50
-
前方障碍的阈值修改。
#define threshold 10(cm)