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

05.Serial Parse Data

Serial Parse Data

Serial Parse Data

Serial Parse DataDevice connectionHardware connectionSoftware connectionSerial port parsing dataControl principleControl pinData format (communication protocol)Code analysisExperimental results

Parse data in a specified data format through the serial port.

xxxxxxxxxx
The format of the serial port parsed data refers to the communication protocol of the WiFi camera module. The serial port control tutorial below also refers to the communication protocol of the WiFi camera module!

Do not install the WiFi camera module here, otherwise it will occupy the serial port and cause abnormal information.

Device connection

Hardware connection

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

Software connection

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

Serial port parsing data

Control principle

Receive data through the serial port and determine whether the data is in the specified format, parse and store the specified data.

Control pin

Use the serial port on the Arduino IDE to send and parse data.

Serial portArduino Uno
RX0
TX1

Data format (communication protocol)

We only parse data in two data formats.

Data formatDescriptionExample
$Data header 
#Data tail 
Data,Data,DataData type 1Data represents only numbers: 1,0,0,0
Alphabet+DataData type 2Alphabet+Data represents a letter plus the following three digits: A100

Example:

Data format 1: $1,0,0,0#, $1,2,0,0#, $1,2,0,1#

Data format 2: $A100#, $A090#, $B120#

Note:

  • Data format 1 is mainly used to control the car status, RGB, and buzzer in the later stage

  • Data format 2 is mainly used to control the servo angle in the later stage

Data needs to be sent strictly in the above format.

Code analysis

Here is only a brief introduction to the code content. For detailed code, please refer to the corresponding code file, which is provided in the download area!

  • Define data such as arrays, flag bits, etc

x
// 定义数据,如数组,标志位等 Define data such as arrays, flag bits, etc
#define BUFFER_SIZE 20
volatile uint8_t Rx_Index = 0;
volatile uint8_t Data_Flag = 0;
char* Data_Array[BUFFER_SIZE];
char Data_Servo[BUFFER_SIZE];

int DataArraySize = 0;
  • Receive data

Note: Receive data between $ and #

xxxxxxxxxx
/**
 * @brief 接收指定格式的数据 Receives data in the specified format
 * @param 无 None
 * @retval 接收指定数据 Received specified data
 */
char* recData() {
  static char Data_Buffer[BUFFER_SIZE];
  static char Rx_Buffer[BUFFER_SIZE];

  if (Serial.available() > 0) {
    char SerialData = Serial.read();
    if (SerialData == '$') {
      memset(Rx_Buffer, 0, sizeof(Rx_Buffer));
      memset(Data_Buffer, 0, sizeof(Data_Buffer));
      Data_Flag = 1;
      Rx_Index = 0;
KEY Control Buzzer
Parse Data Control Motor

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