JanLahmann / RasQberry-Two

The RasQberry project: Exploring Quantum Computing and Qiskit with a Raspberry Pi and a 3D Printer
Apache License 2.0
6 stars 12 forks source link

enable LEDs #38

Open JanLahmann opened 3 weeks ago

JanLahmann commented 3 weeks ago

Enable LED strips and LED Matrix display for both RPi 4 and RPi 5.

JanLahmann commented 3 weeks ago

See https://github.com/JanLahmann/RasQberry/blob/0619f91c6ceb43c94e733ff02ef387c1ab9ee72b/bin/rq_luma_setup.sh in the first RasQberry project

saschaschefenacker commented 3 weeks ago

I could have a look into this one

Hardware requirement: Connect the 'Data In' or DIN line of the neopixels to GPIO Pin 10 (SPI0 MOSI) Physical pin 19 on your Raspberry Pi https://pinout.xyz/pinout/pin19_gpio10 For SPI1 (if required): gpio 20 / pin 38

Software: https://docs.circuitpython.org/projects/neopixel_spi/en/latest/

Setup:

python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-neopixel-spi

Example file: neopixel_spi_IBMtestFunc.py

Command: (paths need to get changed) /home/sascha/.venv/bin/python /home/sascha/neopixel_spi_IBMtestFunc.py

JanLahmann commented 2 weeks ago

Thanks for the first code to enable the LEDs! I think we will use the "default" venv to add such functionality. As some of the demos will want to use LEDs, we will provide a venv with Qiskit and the basic tooling (incl. LEDs) as part of our basic image. The name of the standard venv is defined here: https://github.com/JanLahmann/RasQberry-pi-gen/blob/2a03dbea8da55aa75605693aa0523ace922d7c80/config#L20C1-L20C16 STD_VENV="RQB2". Please use the variable, if possible. Otherwise we can adjust it during final integration into the image.

saschaschefenacker commented 2 weeks ago

the SPI needs to be enabled in the image: https://www.raspberrypi-spy.co.uk/2014/08/enabling-the-spi-interface-on-the-raspberry-pi/

manual: sudo raspi-config

gbanchelli commented 2 weeks ago

the SPI needs to be enabled in the image: https://www.raspberrypi-spy.co.uk/2014/08/enabling-the-spi-interface-on-the-raspberry-pi/

manual: sudo raspi-config

As discussed with @JanLahmann, I will test this and submit a PR for SPI enablement.

saschaschefenacker commented 1 week ago

Thanks! Seems https://github.com/JanLahmann/RasQberry-Two/pull/43 would be ready for the initial merge.