Welcome to 8-Channel Tracking Module repository
IO method
STM32-IO method
STM32-IO methodExperimental preparationExperimental purposeExperimental wiringExperimental steps and phenomenaExperimental source code
Experimental preparation
STM32F103 motherboard, preferably RCT6 or above, this source code uses the pins of the RCT6 version
8-way patrol module
Several Dupont lines
The STM32 board needs to download the IO communication source code provided by the document**
Experimental purpose
The content of this experiment is mainly to use the STM32 master to receive the data of the 8-way patrol module through IO.
Experimental wiring
STM32 to serial port assistant If you are not using the black stm32 of Yabo, you need to use a usb to ttl module to connect to the computer. The wiring is described in the following table
| stm32 | usb to ttl |
|---|---|
| PA10 | TX |
| PA9 | RX |
| vcc | vcc |
| GND | GND |
| If you are using the Yabo black stm32, you can directly use type-c to connect to the computer's serial port assistant |
| STM32 | 8-channel line patrol module |
|---|---|
| PC0 | x1 |
| PC1 | x2 |
| PC2 | x3 |
| PC3 | x4 |
| PA4 | x5 |
| PA5 | x6 |
| PB0 | x7 |
| PB1 | x8 |
As shown in the figure:

Experimental steps and phenomena
After connecting the wires, open the serial port assistant and you can see the numerical data of the infrared module. Set the baud rate to 115200. As shown below

Experimental source code
x
int main(){ SystemInit(); delay_init(); delay_ms(1000);//Wait for infrared to stabilize uart_init(115200); irtracking_init(); while(1) { printf_IR_IO_Data(); delay_ms(300); }}The main function of the source code is very simple, reading the probe pins of the 8-way patrol line and printing them out.