yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
8-Channel Tracking Module📖
0. 8-channel line tracking module usage
  • 8-channel line tracking module usage
1. Single board tutorials
1.arduino
  • I2C method
  • IO method
  • Serial port method
2.STM32
  • I2C method
  • IO method
  • Serial Port method
3.MSPM0G3507
  • I2C method
  • IO method
  • Serial Port method
5.Raspberry Pi
  • I2C method
  • IO method
  • Serial Port method
4.MSPM0G3519
  • I2Cnew
  • IOnew
  • Serial Portnew
2. Car Tutorials
  • 1.STM32-Wheeled car chassis_V1
  • 2.STM32-Wheeled car chassis_V2
  • 3.STM32 development board car
  • 4.STM32 self-balancing car
  • 5.MSPM0-Wheeled car chassis_V1
  • 6.MSPM0G3507-Wheeled car chassis_V2
  • 7.MSPM0G3519-Wheeled car chassis_V2new
  • 8.Arduino car(Roboduino)
  • 9.Raspberry Pi car(RaspbotV2)
3. Expansion Tutorialsnew
  • 1.Autonomous driving car
  • 2.Vehicle-mounted balance ball motion control system
Download
  • Code
  • Protocol
Download ZIP

Welcome to 8-Channel Tracking Module repository

I2C method

arduino - I2C method

arduino - I2C methodExperimental preparationPurposeExperimental wiringExperimental steps and phenomenaExperimental source code

Experimental preparation

  1. Arduino mainboard

  2. 8-channel line patrol module

  3. Several Dupont cables

Adruino board needs to download the I2C communication source code provided in the document

Purpose

The content of this experiment is mainly to use the Arduino master to receive the data of the 8-channel line patrol module through I2C.

Experimental wiring

Adruino connected to the serial port assistant, directly use the program download port to connect

adruino8-channel line patrol module
SDASDA
SCLSCL
5V5V
GNDGND

As shown in the figure: image-2024110100001

Experimental steps and phenomena

  1. 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:

image-20241112143903133

Experimental source code

​x
void loop() {
  
 byte data = 0; // Used to store read data
 
  Wire.beginTransmission(0x12); // The address of the I2C device
  Wire.write(0x30); // Register Address
  Wire.endTransmission();
 
  delay(10); // Give the device enough time to process the request
 
  Wire.requestFrom(0x12, 1); // Request 1 byte of data
  while (Wire.available()) {
    data = Wire.read(); // Reading Data
  }
 
  x1 = (data>>7)&0x01;
  x2 = (data>>6)&0x01;
  x3 = (data>>5)&0x01;
  x4 = (data>>4)&0x01;
  x5 = (data>>3)&0x01;
  x6 = (data>>2)&0x01;
  x7 = (data>>1)&0x01;
  x8 = (data>>0)&0x01;
  sprintf(bufbuf,"x1:%d,x2:%d,x3:%d,x4:%d,x5:%d,x6:%d,x7:%d,x8:%d\r\n",x1,x2,x3,x4,x5,x6,x7,x8);
  Serial.println(bufbuf);
  delay(500);
}

The source code obtains the data of the infrared probe by reading the register address 0x30 of the infrared module and prints it out through the serial port.

 

8-channel line tracking module usage
IO method

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文