Welcome to DOFBOT SE repository
1.Control RGB light
Control RGB Light
1. API Introduction
The API for RGB light:
Arm_RGB_set(R, G, B)
Function: Set the color of the RGB light.
Parameters:
R: Controls the brightness of red color for the RGB light, range 0-255, higher value means brighter.
G: Controls the brightness of green color for the RGB light, range 0-255, higher value means brighter.
B: Controls the brightness of blue color for the RGB light, range 0-255, higher value means brighter.
Return value: None.
2. Code Content
Code path: /home/yahboom/Dofbot/3.ctrl_Arm/1.rgb.ipynb
# Loop to make the RGB light on the DOFBOT expansion board glow red, green, blue.#!/usr/bin/env python3#coding=utf-8import timefrom Arm_Lib import Arm_Device# Get DOFBOT 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 lights up green time.sleep(.5) Arm.Arm_RGB_set(0, 0, 50) # RGB lights up blue time.sleep(.5) print(" END OF LINE! ")try : main()except KeyboardInterrupt: # Release Arm object del Arm print(" Program closed! ") passOpen the 1.rgb.ipynb file from jupyter lab, and click the "Run All" button on the jupyter lab toolbar to see the RGB light on the DOFBOT expansion board cycle through red, green, and blue colors every 0.5 seconds.

To exit, click the Stop button on the toolbar.
