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
Alternate Color Patterns
Moderators: lily.li, violet, salmanfarisvp, seth.welday
Re: Alternate Color Patterns
HI Stephan,
please use below code. thanks.
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()
-
- Pre-kindergarten
- Posts: 6
- Joined: Tue Nov 06, 2018 6:17 am
Re: Alternate Color Patterns
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.
Re: Alternate Color Patterns
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.
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.
-
- Pre-kindergarten
- Posts: 6
- Joined: Tue Nov 06, 2018 6:17 am
Re: Alternate Color Patterns
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.
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.