JOY-iT RB-RGBLED01 RGB-LED Module for Raspberry PI User Guide
- June 6, 2024
- JOY-It
Table of Contents
- RGB-LED Module for Raspberry PI
- Enable audio (loads snd_bcm2835)
- dtparam=audio=on
- Cleaning up after ending the program
- Cleaning up the LED’s on start if the program was interrupted in the previous
- Simple definition for our Color’s
- Read User Manual Online (PDF format)
- Download This Manual (PDF format)
RGB-LED Module for Raspberry PI
RB-RGBLED01
1. General Information
Dear customer, thank you very much for choosing our product.
In following, we will introduce you to what to observe while start-ing up and
using this product.
Should you encounter any unexpected problems during use, please do not
hesitate to contact us.
2. Usage with a Raspberry PI
2.1 Installation of the Software
If you already use the most current Raspbian System on your Rasp-berry Pi, you
can simply skip this step and proceed with Step 1.2.
Please use the program „Win32 Disk Imager“ to install the current Raspbian image on your SD card. You will find the download of it, if you follow this link.
Choose your device by browsing through your files and save the file with Write.
2.2 Connecting the module
Attach the module onto the pins 1 to 26 of your Raspberry Pi, like shown in
the picture below.
Make sure, that the RGB-LED of the module is showing towards the inside.
2.3 Preparing the module
Once you have started the system, open the terminal console and execute the
following commands:
sudo apt-get update
We install the required packages and confirm them with the Y key:
sudo apt-get install gcc make build-essential python-dev git scons swig
For use, the audio output must be deactivated. For this purpo-se we process the files responsible for this. We open it with the command:
sudo nano /etc/modprobe.d/snd-blacklist.conf
Add the following line:
backlist snd_bcm2835
Save and exit the file with the key combination:
CTRL + O , ENTER , CTRL + X
Now open the configuration file with :
sudo nano /boot/config.txt
Scroll down the file to the lines:
Enable audio (loads snd_bcm2835)
dtparam=audio=on
Now comment out the bottom line with a hashtag # so that it looks like this :
dtparam=audio=on
Save and exit the file with the key combination:
CTRL + O , ENTER , CTRL + X
The Raspberry PI must be restarted with the following com-mand:
sudo reboot
2.4 Installing the library
Now that you have prepared the module, we need py-spidev if it is not
already preinstalled, then we use a Python library with the following commands
:
git clone https://github.com/doceme/py-spidev.git
make
cd py-spidev
sudo make install
Then we return with the cd command to download the libra-ry we need for the program (and which was released under the AGPL 3.0 license). To do this we proceed as follows:
git clone https://github.com/joosteto/ws2812-spi.git
2.5 Example code
In the following we use an already existing example code from the library.
This code is a good basis and can be used very well for our single RGB LED.
Therefore we will change the code.
After the last command we can jump directly to the folder we just
downloaded
cd ws2812-spi/
and then use the commaand
sudo nano ownloop.py
to create the file which we are about to write into.
We will now copy the following code into our newly created file.
import spidev
import ws2812
import time
import getopt
stepTime = 1 #Only full Numbers like 1,3,15 or 389 for example
nLED=1 #The ammount of LED’s that are being used
intensity=255 #The Brightnesslevel of the used LED’s
Cleaning up after ending the program
def clean_up(spi):
ws2812.write2812(spi, [0,0,0])
Cleaning up the LED’s on start if the program was interrupted in the previous
run
def clear_on_start(spi):
ws2812.write2812(spi, [0,0,0])
print(“cleaning”)
time.sleep(stepTime)
Simple definition for our Color’s
def RED(spi):
print(“RED”)
d=[[255,0,0]]nLED
ws2812.write2812(spi, d)
time.sleep(stepTime)
d=[[0,0,0]]nLED
def GREEN(spi):
print(“GREEN”)
d=[[0,255,0]]nLED
ws2812.write2812(spi, d)
time.sleep(stepTime)
d=[[0,0,0]]nLED
def BLUE(spi):
print(“BLUE”)
d=[[0,0,255]]nLED
ws2812.write2812(spi, d)
time.sleep(stepTime)
d=[[0,0,0]]nLED
if name==”main”:
spi = spidev.SpiDev()
spi.open(0,0)
try:
while True:
clear_on_start(spi)
RED(spi)
GREEN(spi)
BLUE(spi)
except KeyboardInterrupt:
clean_up(spi)
Now save and exit the file with the key combination:
CTRL + O , ENTER , CTRL + X
The sample code is now finished and is executed with the following command:
sudo python3 loop.py
The execution is stopped with the key combinati-on:
CTRL + C
3. Additional Information
Our information and take-back obligations accord-ing to the Electrical and Electronic Equipment Act (ElektroG)
Symbol on electrical and electronic equipment:
This crossed-out dustbin means that electrical and electronic appli-ances do not belong in the household waste. You must return the old appliances to a collection point. Before handing over waste batteries and accumulators that are not enclosed by waste equipment must be separated from it.
Return options:
As an end user, you can return your old device (which essentially ful-fils the
same function as the new device purchased from us) free of charge for disposal
when you purchase a new device. Small appliances with no external dimensions
greater than 25 cm can be disposed of in normal household quantities
independently of the purchase of a new appliance.
Possibility of return at our company location during opening hours:
Simac Electronics GmbH, Pascalstr. 8, D-47506 Neukirchen-Vluyn, Germany
Possibility of return in your area:
We will send you a parcel stamp with which you can return the de-vice to us
free of charge. Please contact us by e-mail at Service@joy-it.net or by
telephone.
Information on packaging:
If you do not have suitable packaging material or do not wish to use your own,
please contact us and we will send you suitable packag-ing.
4. Support
If there are still any issues pending or problems arising after your purchase,
we will support you by e-mail, telephone and with our ti-cket support system.
E-Mail: service@joy-it.net Ticket system: http://support.joy-it.net
Telephone: +49 (0)2845 98469-66 (10-17 o‘clock)
For further information please visit our website:
www.joy-it.net
www.joy-it.net
Simac Electronics Handel GmbH
Pascalstr. 8 47506 Neukirchen-Vluyn
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>