Hello! I am really new to Rust, especially in Embedded Rust with the Embassy framework. I have a project for university where I am building WS2812B led strip and a sound sensor. I tried all the crates I found, but nothing worked, especially for the LED strip. I was able to write the code I in MicroPython, but I want to use Rust. I am really desperate and I'd really need some help.
I am using a PICO W as a hardware.
Thank you for your attention!
The code:
from neopixel import Neopixel
import time
pix = Neopixel(8, 0, 0, "GRB")
mic = Pin(1, machine.Pin.IN, machine.Pin.PULL_DOWN)
c = 0
color_dict = {0:(255, 100, 0),
1:(255,50,0),
2:(0, 255, 0),
3:(0,0,255),
4:(255, 0, 0),
5:(0, 255, 100),
6:(255, 255,255)}
while True:
print(mic.value())
if mic.value() == 1:
pix.brightness(255)
pix.fill(color_dict[0])
pix.show()
else:
pix.brightness(255)
pix.fill((0,0,0))
pix.show()