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

Raspberry Pi - I2C Method

Raspberry Pi - I2C MethodExperimental preparationExperimental purposeExperimental wiringExperimental steps and phenomenaExperimental source code

Experimental preparation

  1. Raspberry Pi motherboard

  2. 8-channel line patrol module

  3. Several Dupont cables

The Raspberry Pi board needs to download the I2C communication source code provided in the document, and the Raspberry Pi system needs to open the i2c communication interface through raspi-config

Experimental purpose

The content of this experiment is mainly to use the Raspberry Pi main control to receive the data of the 8-channel line patrol module through I2C.

Experimental wiring

Raspberry Pi8-channel line patrol module
SCLSCL
SDASDA
5v5v
GNDGND

As shown in the figure: image-2024110100001

Experimental steps and phenomena

  1. After connecting the wires, run the script:

python3 IR_I2C.py

image-2024110100002

 

Experimental source code

xxxxxxxxxx
#Reading Data
while True:
    time.sleep(0.5) #500ms
    data = read_from_i2c(0x30)
    #print("i2cdata:"+str(data))
    x1 = str((data>>7)&0x01)
    x2 = str((data>>6)&0x01)
    x3 = str((data>>5)&0x01)
    x4 = str((data>>4)&0x01)
    x5 = str((data>>3)&0x01)
    x6 = str((data>>2)&0x01)
    x7 = str((data>>1)&0x01)
    x8 = str((data>>0)&0x01)
    print("x1:"+x1+"  x2:"+x2+"  x3:"+x3+"  x4:"+x4+"  x5:"+x5+"  x6:"+x6+"  x7:"+x7+"  x8:"+x8) 

The main function of the source code is very simple. It reads the probe pins of 8-way line patrol through I2C and prints them out.

 

 

Serial Port method
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

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文