yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Pico Robot Car📖
0.Introduction
  • 0.1 Description of Pico Robot
  • 0.2 Interface Description
1.Assembly steps
  • Assembly video
2.Development environment construction
  • 2.1 Update firmware
  • 2.2 Build environment
  • 2.3 Download code Startup automatically
  • 2.4 Import library file
3.Basic course
  • 3.1 Control LED light
  • 3.2 Onboard temperature sensor
  • 3.3 Passive buzzer
  • 3.4 Breathing light
  • 3.5 Marquee light
  • 3.6 OLED display
  • 3.7 Battery power display
  • 3.8 Servo control
4.Advanced course
  • 4.1 Light sensor
  • 4.2 Sound sensor
  • 4.3 Tracking sensor
  • 4.4 Ultrasonic sensor
  • 4.5 IR control display
5.Robot course
  • 5.1 Car forward
  • 5.2 Car movement
  • 5.3 Singing dancing
  • 5.4 Car tracking
  • 5.5 Edge detection
  • 5.6 Ultrasonic avoiding
  • 5.7 Ultrasounic following
  • 5.8 Light follow
  • 5.9 Voice control car
  • 5.10 Infrared control
  • 5.11 Bluetooth control
6.Battery and charge
  • Battery and charge
Download
  • APP(iOS/Android)
  • Code
  • Instructions Manual
  • Appendix
Download ZIP

Welcome to Pico Robot Car repository

3.5 Marquee light

3.5 Marquee

1. Learning Objectives

  1. Learn to combine the programmable RGB lights of the Raspberry Pi Pico 2/Pico mainboard and the car expansion board for experiments.
  2. Understand the use of programmable RGB lights to achieve the marquee effect.

2. Hardware Usage

This course uses the Pico 2/Pico mainboard and the car onboard programmable RGB lights

image-20220217112502122

The car has 8 programmable RGB lights onboard, which can achieve colorful lighting effects. The 8 programmable lights have built-in ws2812 chips. Only one port is needed to control 8 lights at the same time through timing control. The timing control function is encapsulated in the library. We only need to call to set the color of the light.

3. Program Analysis

Code path: Code -> 1.Basic course -> 5. Horse race lamp.py

​x
import time
from pico_car import ws2812b
​
num_leds = 8  # Number of NeoPixels
# Pin where NeoPixels are connected
pixels = ws2812b(num_leds, 0)
# Set all led
pixels.fill(10,10,10)
pixels.show()
# horse race lamp
while True:
    for i in range(num_leds):
        for j in range(num_leds):
            #pixel_num, red, green, blue
            pixels.set_pixel(j,abs(i+j)%10,abs(i-(j+3))%10,abs(i-(j+6))%10)
        pixels.show()
        time.sleep(0.05)
​

from pico_car import ws2812b

Since we only want to turn on the lights, we only use the ws2812b from pico_car.

import time

The "time" library. This library handles everything to do with time, from measuring it to inserting delays into the program. The unit is seconds.

pixels = ws2812b(num_leds, 0)

Initialize the RGB lights. We have 8 RGB lights, so here num_leds is set to 8.

pixels.fill(10,10,10)

Set all lights to 10,10,10. The parameters are (red, green, blue), and the color brightness is 0-255.

pixels.show()

Display the set lights.

pixels.set_pixel(j,abs(i+j)%10,abs(i-(j+3))%10,abs(i-(j+6))%10)

This function is used to set the color of each light. The parameters are (light number, red, green, blue). The light number starts from 0 and the color brightness is 0-255. Here, two for loops are used to set the variable value to achieve the marquee effect.

4. Experimental Phenomenon

After the program is downloaded, we can see the marquee effect under the car.

Breathing light
OLED display

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
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文