Hi,
I’m using ReSpeaker Core V2.0. I’m trying to test the pixel ring LED using code from
https://github.com/respeaker/pixel_ring.git
Below is the code I used, a bit modified from pixel_ring/examples/respeaker_v2_pixel_ring.py
"""
Control pixel ring on ReSpeaker V2
sudo apt install python-mraa libmraa1
pip install pixel-ring
“”"
import time
from pixel_ring import pixel_ring
import mraa
import os
en = mraa.Gpio(12)
if os.geteuid() != 0 :
time.sleep(1)
en.dir(mraa.DIR_OUT)
en.write(0)
pixel_ring.set_brightness(20)
if name == ‘main’:
while True:
try:
pixel_ring.set_color(r=200, g=0, b=0)
except KeyboardInterrupt:
break
pixel_ring.off()
time.sleep(1)
en.write(1)
The code runs without errors, but the pixel ring LED won’t turn on. I’ve tried changing /boot/config-4.4.138-respeaker-r0 to enable CONFIG_SPI_GPIO=y, but still doesn’t work. I’m using SD boot image. Could this be a problem of GPIO operation? or my device is not recognizing SPI devices?