yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Raspbot V2📖
1.About Raspbot V2
  • 1. First trial
  • 2. Expansion board interface distribution
  • 3. About battery and charging
  • 4. Install servo PTZ
  • 5.Servo Gimbal Installation
  • 6. Important Notes (Read Before Starting)
2.Assembly
  • Installation Video
3.Car basic course
  • 0. Preparation before development
  • 1.Buzzer control
  • 2.Key reading
  • 3.RGB control
  • 4.Servo control (PTZ control)
  • 5.Motor control
  • 6.Printing ultrasonic data
  • 7.Tracking module status printing
  • 8.IR control key value printing
4.Car motion control course
  • 0.Mecanum wheel motion principle
  • 1.Car vertical movement
  • 2.Car diagonal movement
  • 3.Car sideways movement
  • 4.Car rotation movement
  • 5.Car patrol
5.Car advanced courses
  • 1.Infrared patrol car
  • 2.Ultrasonic avoid
  • 3.Ultrasonic follow
  • 4.Infrared tracking+ ultrasonic avoid
  • 5.Restricting
  • 6.Infrared remote control car
6.OpenCV courses
A. Getting Started with OpenCV
  • 1. Introduction to OpenCV
  • 2.OpenCV image reading and display
  • 3. OpenCV image writing
  • 4. OpenCV Image Quality
  • 5.OpenCV pixel operations
B. OpenCV geometric transformation
  • 1. Image scaling
  • 2. Image cutting
  • 3. Image translation
  • 4. Image mirroring
  • 5. Affine Transformation
  • 6. Image Rotation
  • 7. Perspective Transformation
C. OpenCV image processing and text line drawing
  • 1. Grayscale processing
  • 2. Image Binarization
  • 3. Edge Detection
  • 4. Line drawing
  • 5. Rectangle and circle drawing
  • 6. Text and image drawing
D. Image beautification
  • 1. Color Image Histogram
  • 2. Histogram Equalization
  • 3. Image repair
  • 4. Brightness enhancement
  • 5. Smooth and whiten
  • 6. Gaussian mean filtering
  • 7. Median Filter
E. Machine Learning
  • 1. KNN
  • 2. SVM
7.AI vision recognition course
  • 1.Camera driver tutorial
  • 2.Color recognition
  • 3.HSV value test
  • 4.Object Recognition
  • 5.QR code recognition
  • 6.Face recognition
  • 7.License Plate Recognition
  • 8. Human Pose Estimation
  • 9. Target detection
  • 10.yolov5-lite
  • 11. Gesture Recognition
  • 12. Face Detection
  • 13. Face effects
  • 14. 3D Object Recognition
  • 15. Paintbrush
  • 16. Finger control
8.AI vision interaction module
  • 1. Color tracking
  • 2. Color follows
  • 3. QR code recognition to control movement
  • 4. Face tracking
  • 5. Face following
  • 6. Visual tracking
  • 7. Garbage identification
  • 8. Track map Autopilot(purchased separately)
  • 9. Gesture following
9.Voice control basic course(For Superior Kit)new
  • 1.Voice control car movement
  • 2.Voice control RGB light
  • 3.Voice control color recognition
  • 4.Voice control autonomous driving
  • 5.Voice control car tracking
10.AI large model knowledge(For Superior Kit)new
  • 1.AI large model types and principles
  • 2.RAG retrieval enhancement and model training samples
  • 3.Embodied intelligent robot system architecture
  • 4.Embodied intelligent functions core source code
  • 5.Configure AI large model(Required)
11.AI Large Model Development(For Superior Kit & Reference)new
  • 1.Register a model service provider account
  • 2. Configuring API-KEY(Optional)
  • 3. Introduction to Dify
  • 4. Basic Dify Features
  • 5. Deploy the RAG knowledge base
  • 6. AI Large Model Development - chatbot
  • 7. RAG knowledge base + chatbot
  • 8. AI agent workflow
  • 9. Custom wake-up response
  • 10. Core module testing tools
12.AI large basic course(For Superior Kit)new
  • 1.Free conversation
  • 2.Text-to-picture
  • 3.Scene description
  • 4.Video description
  • 5.Intelligent action choreography
  • 6.Dual-model agent application
13.ROS2-Robot chassis control course
  • 1. Robot information release
  • 2. Robot keyboard control
  • 3. URDF Model
14.ROS2-OpenCV course
  • 1.ROS+Opencv application
  • 2. AR Vision
  • 3. Mediapipe fun gameplay
  • 4. Gesture control car movement
  • 5. Gesture control car actions
  • 6. Palm control car movement
  • 7. Palm control servo PTZ
  • 8. Visual tracking
  • 9. AprilTag code recognition
  • 10. AprilTag tag code tracking
  • 11. AprilTag tag code follow
15.Development environment course
  • 1. Introduction to Raspberry Pi 5
  • 2. Image writing and backup
  • 3. Start the Raspberry Pi 5
  • 4. Remote Access
  • 5. Remote file transfer
  • 6. Common Linux commands and use of vim editor
  • 7. Install Raspbot V2 driver library
  • 8. Jupyter Lab environment construction
  • 9. Jupyter Lab plugin installation
  • 10. Basic use of Jupyter Widgets
16.Raspberry Pi basic settings
  • 1.Update and upgrade the operating system
  • 2. Introduction to raspi-config tool
  • 3. config.txt file description
  • 4. Network Configuration
  • 5. Set display resolution and rotation
  • 6. Set screen sleep
  • 7. Get real-time temperature of RPi
  • 8. Play audio and video
  • 9. Use USB Camera
  • 10.Use MIPI camera
17.Docker course
  • 1. Overview and installation
  • 2. Common commands
  • 3. Understand and publish images
  • 4. Docker data processing
  • 5. Enter docker container
18.ROS2 basic course
  • 1. Introduction to ROS2
  • 2.ROS2 install Humble
  • 3. ROS2 development environment
  • 4. ROS2 workspace
  • 5. ROS2 function package
  • 6. ROS2 node
  • 7.ROS2 topic communication
  • 8. ROS2 service communication
  • 9. ROS2 action communication
  • 10. ROS2 custom interface message
  • 11. ROS2 parameter service case
  • 12. ROS2 meta-function package
  • 13. ROS2 distributed communication
  • 14. ROS2 DDS
  • 15. ROS2 time related API
  • 16. ROS2 common command tools
  • 17. ROS2 rviz2 use
  • 18. ROS2 rqt toolbox
  • 19. ROS2 Launch startup file configuration
  • 20. ROS2 recording and playback tool
  • 21. ROS2 URDF model
  • 22. ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
Download
  • APP(iOS/Android)
  • Code
  • System_File
  • Instruction Manual
  • Hardware_Info
  • 3D_Model_File
  • ROS2_Basic_VM
Download ZIP

Welcome to Raspbot V2 repository

当製品の日本語版マニュアル資料は、こちらからご取得ください。

7. Install Raspbot V2 driver library

7. Install Raspbot V2 driver library

7. Install Raspbot V2 driver library7.1. Statement before installing the driver library7.2. Download Python driver library file7.3. Transfer files to Raspberry Pi 57.4. Start installation7.5. Import library files7.6、API简介7.7 API Testing

7.1. Statement before installing the driver library

The factory image system of the car has already installed the latest driver library, so there is no need to install it again. If you are not using the factory image, or the driver library has updated content, you need to install the driver library.

The storage path of the driver library that comes with the factory system: ~/py_install

Please refer to the following steps to install the driver library. Here, the installation of version V0.0.2 is taken as an example.

7.2. Download Python driver library file

The latest version of Raspbot V2 driver library is provided in this course material, named py_install.zip.

The compressed package contains the following files:

7.3. Transfer files to Raspberry Pi 5

If you use the browser that comes with Raspberry Pi 5 to download files from Yabo Smart Official Website, please download the files to a user-operable path, such as the desktop.

If you use the driver library compressed package file in the data, or download the driver library file with a computer browser, you can use WinSCP software to drag the driver library compressed package file to the Raspberry Pi 5 desktop.

After successful installation, the driver library file can be deleted.

If you don’t know how to use WinSCP to transfer files, you can refer to 5. Remote file transfer

7.4. Start installation

Open the terminal of Raspberry Pi 5 and enter the following command to decompress.

Enter the desktop and check if the file exists. The target file is in the red box.

xxxxxxxxxx
cd ~/Desktop && ls

Unzip the file

xxxxxxxxxx
unzip py_install.zip

Note: The entire document example uses the py_install.zip compressed package placed on the Raspberry Pi 5 system desktop as an example. If the compressed package is stored in a different path, please enter the corresponding directory according to the actual path.

Enter the driver library folder

xxxxxxxxxx
cd py_install

Run the installation command. If you see the installation version number at the end, it means the installation is successful. This command will overwrite the previously installed Raspbot V2 driver library.

xxxxxxxxxx
sudo python3 setup.py install

7.5. Import library files

Refer to the following picture to import the driver library. If no error message appears, the installation is successful.

7.6、API简介

xxxxxxxxxx
class Raspbot():
"""
Raspberry Pi car control class, used to communicate with the Raspberry Pi car via I2C.
"""

def get_i2c_device(self, address, i2c_bus):
"""
Get the I2C device instance.

Args:
address (int): I2C device address.
i2c_bus (int): I2C bus number.

Returns:
SMBus: I2C device instance.
"""

def __init__(self):
"""
Initialize the Raspbot instance and create an I2C device.
"""

def write_u8(self, reg, data):
"""
Write a byte of data to the specified register.

Args:
reg (int): register address.
data (int): data to be written.
"""

def write_reg(self, reg):
"""
Command to write a byte to the device.

Args:
reg (int): command byte.
"""

def write_array(self, reg, data):
"""
Write a series of bytes of data to the specified register.

Args:
reg (int): register address.
data (list): list of data to be written.
"""

def read_data_byte(self):
"""
Read a byte of data from the device.

Returns:
int: data read.
"""

def read_data_array(self, reg, length):
"""
Read a series of bytes of data from the specified register.

Args:
reg (int): register address.
length (int): length of data to be read.

Returns:
list: list of data read.
"""

def Ctrl_Car(self, motor_id, motor_dir, motor_speed):
"""
Control the direction and speed of the motor.

Args:
motor_id (int): motor ID.
motor_dir (int): Motor direction (0 is forward, 1 is reverse).
motor_speed (int): Motor speed (0-255).
"""

def Ctrl_Muto(self, motor_id, motor_speed):
"""
Controls the motor forward and reverse, accepts speed values ••from -255 to 255.

Args:
motor_id (int): Motor ID.
motor_speed (int): Motor speed (-255 to 255).
"""

def Ctrl_Servo(self, id, angle):
"""
Controls the angle of the servo.

Args:
id (int): Servo ID.
angle (int): Servo angle (0-180 degrees).
"""
def Ctrl_WQ2812_ALL(self, state, color):
"""
Control the state and color of all LED lights.

Args:
state (int): The state of the light (0 is off, 1 is on).
color (int): Color code.
"""

def Ctrl_WQ2812_Alone(self, number, state, color):
"""
Control the state and color of a single LED light.

Args:
number (int): The number of the light.
state (int): The state of the light (0 is off, 1 is on).
color (int): Color code.
"""

def Ctrl_WQ2812_brightness_ALL(self, R, G, B):
"""
Set the RGB brightness of all LED lights.

Args:
R (int): Red brightness (0-255).
G (int): Green brightness (0-255).
B (int): Blue brightness (0-255).
"""

def Ctrl_WQ2812_brightness_Alone(self, number, R, G, B):
"""
Set the RGB brightness of a single LED.

Args:
number (int): The number of the LED.
R (int): Red brightness (0-255).
G (int): Green brightness (0-255).
B (int): Blue brightness (0-255).
"""

def Ctrl_IR_Switch(self, state):
"""
Control the on/off state of the infrared remote control.

Args:
state (int): Switch state (0 is off, 1 is on).
"""

def Ctrl_BEEP_Switch(self, state):
"""
Control the on/off state of the buzzer.

Args:
state (int): Switch state (0 is off, 1 is on).
"""

def Ctrl_Ulatist_Switch(self, state):
"""
Controls the switch state of the ultrasonic ranging module.

Args:
state (int): Switch state (0 is off, 1 is on).
"""

class LightShow():
"""
LED light effect control class, used to achieve various lighting effects.
"""

def __init__(self):
"""
Initialize the LightShow instance, set basic parameters and initialize the Raspberry Pi car control object.
"""

def execute_effect(self, effect_name, effect_duration, speed, current_color):
"""
Execute the specified lighting effect.

Args:
effect_name (str): Effect name.
effect_duration (float): Effect duration (seconds).
speed (float): Effect execution speed (seconds).
current_color (int): Current color code.
"""

def turn_off_all_lights(self):
"""
Turn off all LED lights.
"""

def run_river_light(self, effect_duration, speed):
"""
Execute the running light effect.

Args:
effect_duration (float): Effect duration (seconds).
speed (float): Effect execution speed (seconds).
"""

def breathing_light(self, effect_duration, speed, current_color):
"""
Execute the breathing light effect.

Args:
effect_duration (float): Effect duration (seconds).
speed (float): Effect execution speed (seconds).
current_color (int): Current color code.
"""

def random_running_light(self, effect_duration, speed):
"""
Execute the random running light effect.

Args:
effect_duration (float): Effect duration (seconds).
speed (float): Effect execution speed (seconds).
"""

def starlight_shimmer(self, effect_duration, speed):
"""
Executes the starlight shimmer effect.

Args:
effect_duration (float): Effect duration (seconds).
speed (float): Effect execution speed (seconds).
"""

def gradient_light(self, effect_duration, speed):
"""
Executes the gradient effect.

Args:
effect_duration (float): Effect duration (seconds).
speed (float): Effect execution speed (seconds).
"""

def rgb_remix(self, val):
"""
RGB value mixing algorithm.

Args:
val (int): Input RGB value.

Returns:
int: RGB value after mixing.
"""

def rgb_remix_u8(self, r, g, b):
"""
RGB value mixing algorithm (for 8-bit values).

Args:
r (int): Red value.
g (int): Green value.
b (int): Blue value.

Returns:
tuple: RGB value after mixing.
"""

def calculate_breath_color(self, color_code, breath_count):
"""
Calculate the color value of the breathing light effect.

Args:
color_code (int): Color code.
breath_count (int): Breath count.

Returns:
tuple: RGB color value.
"""

def stop(self):
"""
Stop the currently executing lighting effect.
"""

7.7 API Testing

​x
# test
#car = Raspbot()

#Read the line patrol sensor address, this value is only 1 bit
# track =car.read_data_array(0x0a,1)
# track = int(track[0])
# x1 = (track>>3)&0x01
# x2 = (track>>2)&0x01
# x3 = (track>>1)&0x01
# x4 = (track)&0x01
# print(track,x1,x2,x3,x4)

#Read the ultrasonic sensor address, this value is only 2 bits
# car.Ctrl_Ulatist_Switch(1)#open
# time.sleep(1)
# diss_H =car.read_data_array(0x1b,1)[0]
# diss_L =car.read_data_array(0x1a,1)[0]
# dis = diss_H<< 8 | diss_L
# print(dis+"mm")
# car.Ctrl_Ulatist_Switch(0)#close

#Read the value of infrared remote control
# car.Ctrl_IR_Switch(1)
# time.sleep(3)
# data =car.read_data_array(0x0c,1)
# print(data)
# car.Ctrl_IR_Switch(0)

#Buzzer test
# car.Ctrl_BEEP_Switch(1)
# time.sleep(1)
# car.Ctrl_BEEP_Switch(0)
# time.sleep(1)

#Motor test
# car.Ctrl_Car(0,0,150) #L1 motor forward 150 speed
# car.Ctrl_Car(1,0,150) #L2 motor forward 150 speed
# car.Ctrl_Car(2,0,150) #R1 motor forward 150 speed
# car.Ctrl_Car(3,0,150) #R2 motor forward 150 speed
# time.sleep(1)
# car.Ctrl_Car(0,1,50) #L1 motor backward 50 speed
# time.sleep(1)
# car.Ctrl_Car(0,0,0) #L1 motor stop
# car.Ctrl_Car(1,0,0) #L2 motor stop
# car.Ctrl_Car(2,0,0) #R1 motor stop
# car.Ctrl_Car(3,0,0) #R2 motor stop
#Servo test
# car.Ctrl_Servo(1,0) #s1 0 degrees
# car.Ctrl_Servo(2,180) #s2 180 degrees
# time.sleep(1)
# car.Ctrl_Servo(1,180) #s1 180 degrees
# car.Ctrl_Servo(2,0) #s2 0 degrees
# time.sleep(1)

# light bar test
# car.Ctrl_WQ2812_ALL(1,0)# red
# time.sleep(1)
# car.Ctrl_WQ2812_ALL(1,1)# green
# time.sleep(1)
# car.Ctrl_WQ2812_ALL(1,2)# blue
# time.sleep(1)
# car.Ctrl_WQ2812_ALL(1,3)# yellow
# time.sleep(1)
# car.Ctrl_WQ2812_ALL(0,0) # off

# single light test
# car.Ctrl_WQ2812_Alone(1,1,0)# red No. 1
# time.sleep(1)
# car.Ctrl_WQ2812_Alone(2,1,3)# yellow No. 1
# time.sleep(1)
# car.Ctrl_WQ2812_Alone(1,0,3)#1 off
# time.sleep(1)
# car.Ctrl_WQ2812_Alone(10,1,2)#10 green
# time.sleep(1)
# car.Ctrl_WQ2812_ALL(0,0) #off

#control brightness test all
# for i in range(255):
# car.Ctrl_WQ2812_brightness_ALL(i,0,0)
# time.sleep(0.01)
Common Linux commands and use of vim editor
Jupyter Lab environment construction

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