Alternate Color Patterns

info about ReSpeaker series products

Moderators: lily.li, violet, seth.welday

Post Reply
stephan679
Pre-kindergarten
Pre-kindergarten
Posts: 6
Joined: Tue Nov 06, 2018 6:17 am

Alternate Color Patterns

Post by stephan679 » Tue Nov 13, 2018 12:57 pm

Hi all - I have been reviewing all of the code associated with the Alexa and Google Home color patterns and trying to figure out the dang logic behind the patterns. I want to create a new pattern specific to my project with specific colors and sweeping patterns but the code is overwhelming to me.

for examples see: https://github.com/respeaker/4mics_hat/ ... pattern.py

Does anyone know a simpler method to call the LED's, set the colors, and set the timing?

Thanks,
Stephan

bill.yu
Junior-7
Junior-7
Posts: 733
Joined: Mon Apr 02, 2018 11:05 am

Re: Alternate Color Patterns

Post by bill.yu » Thu Nov 29, 2018 4:20 pm

HI Stephan,

please use below code. thanks.

Code: Select all

import time

from pixel_ring import pixel_ring
from gpiozero import LED

power = LED(5)
power.on()

pixel_ring.set_brightness(10)

pixel_ring.set_color(0,255,0)
time.sleep(3)
pixel_ring.off()
power.off()

stephan679
Pre-kindergarten
Pre-kindergarten
Posts: 6
Joined: Tue Nov 06, 2018 6:17 am

Re: Alternate Color Patterns

Post by stephan679 » Thu Jan 31, 2019 12:59 pm

Thanks for this, but it fails because I don't seem to have the respeaker.usb_hid installed properly?
Last edited by stephan679 on Wed Feb 06, 2019 10:51 am, edited 1 time in total.

bill.yu
Junior-7
Junior-7
Posts: 733
Joined: Mon Apr 02, 2018 11:05 am

Re: Alternate Color Patterns

Post by bill.yu » Fri Feb 01, 2019 5:48 pm

Hi Stephan,

1. do you use the 4 mics pi hat?

2. what kinds of error do you have?

3. do you open the spi interface as below?
sudo raspi-config
Go to "Interfacing Options"
Go to "SPI"
Enable SPI
Exit the tool

4. we use the pixel library from https://github.com/respeaker/pixel_ring ... pixel_ring thanks.

stephan679
Pre-kindergarten
Pre-kindergarten
Posts: 6
Joined: Tue Nov 06, 2018 6:17 am

Re: Alternate Color Patterns

Post by stephan679 » Wed Feb 06, 2019 10:49 am

Thanks for the above, but I searched around and was able to reinstall usb_hid and it now works.

I now just need to figure out how to do patterns. The above code seems to turn them all on or all off. That is a start.

Post Reply