Welcome to DOFBOT Pro repository
1. Control RGB Light
Control RGB Light
1. API Introduction
The API corresponding to the RGB light is: Arm_RGB_set(R, G, B)
Function: Set the color of the RGB light.
Parameter explanation:
R: Control the brightness of the red light in RGB, range is 0-255, the larger the value, the brighter the light.
G: Control the brightness of the green light in RGB, range is 0-255, the larger the value, the brighter the light.
B: Control the brightness of the blue light in RGB, range is 0-255, the larger the value, the brighter the light.
Return value: None.
2. Code Content
Code path:
~/dofbot_pro/dofbot_ctrl/scripts/01.rgb.ipynb
x#!/usr/bin/env python3#coding=utf-8import timefrom Arm_Lib import Arm_Device# Get the robotic arm objectArm = Arm_Device()time.sleep(.1)def main(): while True: Arm.Arm_RGB_set(50, 0, 0) # RGB lights up red time.sleep(.5) Arm.Arm_RGB_set(0, 50, 0) # RGB green light time.sleep(.5) Arm.Arm_RGB_set(0, 0, 50) # RGB blue light time.sleep(.5) print(" END OF LINE! ")try : main()except KeyboardInterrupt: # Release the Arm object del Arm print(" Program closed! ") passOpen the code file from jupyter lab, and click the "Run entire notebook" button on the jupyter lab toolbar, you can see the RGB light on the robotic arm expansion board cycling through red, green, and blue lights every 0.5 seconds.

To exit, click the stop button on the toolbar.
