yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Roboduino V2📖
0.Instruction manual
  • Instruction manual
1.Get started quickly
  • 01.Assembly of the Car
  • 02.Remote Control Car
  • 03.Common Problem Analysis
  • 04. Lithium Battery Pack and Charger Usage Guidelines
  • 05. Important Notes (Read Before Starting)
2.Environment Construction
  • 01.Serial port driver installation
  • 02.Arduino IDE Installation
  • 03.Arduino IDE usage
  • 04.Using third-party libraries
  • 05.Program compilation and upload
3.Basic car course
  • 01.RGB Control
  • 02.Serial Print
  • 03.KEY Read
  • 04.Buzzer control
  • 05.Logo Breath
  • 06.Servos Control
  • 07.Motor Control
  • 08.Ultrasonic Ranging
  • 09.Track Print
  • 10.Infrared Remote Print
  • 11.WIFI Camera
4.Advanced car course
  • 01.RGB Breath
  • 02.Play Music
  • 03.KEY Control RGB
  • 04.KEY Control Buzzer
  • 05.Serial Parse Data
  • 06.Parse Data Control Motor
  • 07.Parse Data Control RGB
  • 08.Parse Data Control Buzzer
  • 09.Parse Data Control Servo
5.Car motion control
  • 00.Mecanum wheel motion principle
  • 01.Car Vertical Movement
  • 02.Car Diagonal Movement
  • 03.Car Sideways Movement
  • 04.Car Rotational Movement
  • 05.Car Patrol
6.Comprehensive gameplay of car
  • 01.Car tracking
  • 02.Car Obstacle Avoid
  • 03.Car Follow Hand
  • 04.Car tracking Avoid
  • 05.Car Infrared Remote
  • 06.WiFi Control Car
  • 07.IR WiFi Control Car
7.AI vision course
  • 1. Cat(dog) detection
  • 2. Color recognition
  • 3. QR code instructions
  • 4. Person Recognition
  • 5. Face Detection
  • 6. Color Follows
  • 7. Face following
8.Expand peripherals
  • 01.Digital Tube Display
  • 02.Color Recognition
Download
  • Code
  • Library
  • Hardware manual
  • Software
  • 3D Model
  • Instruction Manual
Download ZIP

Welcome to Roboduino V2 repository

09.Track Print

Track Print

Track Print

Track PrintDevice connectionHardware connectionSoftware connectionThree-way patrol moduleControl principleControl pinCode analysisExperimental results

Use the serial port to print the data of the three-way patrol module and the direction that the simulated car needs to change.

Device connection

Hardware connection

Use the Type-B data cable to connect the Arduino Uno and the computer.

Software connection

Open the "Arduino IDE" software and select the model and serial port number corresponding to the development board.

Three-way patrol module

The basic principle of infrared sensor patrol is to use the reflective properties of objects: when infrared rays are emitted to the black line, they will be absorbed by the black line, and when they are emitted to materials of other colors, they will be reflected to the infrared receiver.

The position selected by the red box is the location of the three-way patrol module interface:

image-20240605192657816

Control principle

By reading the analog value data of the three-way line patrol module X1, X2, and X3 interfaces, the location of the black line is determined.

image-20240605193614692

xxxxxxxxxx
When the three-way tracking module is installed, the infrared tracking sensor faces the ground, so the left, middle, and right sensors in the program are based on the left mark in the above figure

Control pin

The three-way line patrol module and the Robduino expansion board have a special interface for installation and connection.

Peripheral moduleArduino Uno
VCCVCC
X1X1 (A0)
X2X2 (A1)
X3X3 (A2)
GNDGND

Note: The infrared light emitted by the infrared probe is invisible to the human eye; in order to avoid infrared light interfering with the sensor, we need to use this module indoors.

Code analysis

Here we only briefly introduce the code content. For detailed code, please refer to the corresponding code file, which is provided in the download area!

  • Define the three-way line patrol module pins and black line threshold

​x
// 定义三路循迹模块引脚 Define the three-way line patrol module pins
#define L_TRACK_PIN A2
#define M_TRACK_PIN A1
#define R_TRACK_PIN A0

// 定义巡线阈值 Define the patrol threshold
const int Threshold = 500;
  • Get line patrol data and status

xxxxxxxxxx
/**
 * @brief 获取三路巡线模块数据和状态 Get the status of the three-way line patrol module
 * @param iLeftPin: 左边红外传感器 Left tracking sensor
 * @param iMidPin: 中间红外传感器 Middle tracking sensor
 * @param iRightPin: 右边红外传感器 Right tracking sensor
 * @retval 无 None
 */
void getTrackLineState(int iLeftPin, int iMidPin, int iRightPin) {
  int leftValue = analogRead(iLeftPin);
  int middleValue = analogRead(iMidPin);
  int rightValue = analogRead(iRightPin);

  Serial.print("Left: ");
  Serial.print(leftValue);
  Serial.print("  Middle: ");
  Serial.print(middleValue);
  Serial.print("  Right: ");
  Serial.print(rightValue);

  // 进行简单的方向判断打印 The following is a simple judgment
  if (leftValue > Threshold && middleValue < Threshold && rightValue < Thre
Ultrasonic Ranging
Infrared Remote Print

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/中文