I have the 4-Mic Array with 12 circular LED’s on top. It is on a Raspberry Pi 3B+ and working fine. In fact it is a great little device.
My problem is that I am really struggling with fully understanding how to control the LED patterns. I have been through the demo files (which all work fine) very slowly several times and I am still having a hard time with it. I would like to generate my own patterns and colors, but I just can’t seem to get a grip here. I have taken several online Python courses and have a strong basic understanding of the code, I just can’t seem to figure out the correct way to do this.
If there is anyone out there willing to give me a lesson or point me to a “for dummies” resource I would really appreciate the help.
OK, went through that and it is the same issue. A .py file that calls another one that calls another one until I am confused as hell.
Let’s make it simple. Can anyone tell me how to change the blue to any other color in the Alexa or Echo pattern?
- Install the git client: sudo apt install -y git
- Prepare GIT: git config --global user.name “John Doe” && git config --global user.email firstname.lastname@example.org
- Create a development directory and change into it: mkdir ~/Development && cd ~/Development
- Get the APA102 Library and sample light programs: git clone https://github.com/tinue/apa102-pi.git && cd apa102-pi
- cd apa102-pi && nano sample.py; Update as below, Ctrl-X and “Yes” to save. you can change any led and any color at strip.set_pixel_rgb(5, 0xFF0000).
“”“Ultra simple sample on how to use the library”""
from driver import apa102
from gpiozero import LED
power = LED(5)
Initialize the library and the strip
strip = apa102.APA102(num_led=12, global_brightness=100, mosi = 10, sclk = 11,
Turn off all pixels (sometimes a few light up when the strip gets power)
Prepare a few individual pixels
strip.set_pixel_rgb(5, 0xFF0000) # Red
strip.set_pixel_rgb(6, 0xFFFFFF) # White
strip.set_pixel_rgb(8, 0x00FF00) # Green
Copy the buffer to the Strip (i.e. show the prepared pixels)
Wait a few Seconds, to check the result
6.Run the sample lightshow: ./sample.py.