User Manual
Table Of Contents
VMP502
V. 02 – 25/10/2019 16 ©Velleman nv
hardware PWM output, but it needs three channels to control the RGB LED, which means it is diffeicult to
control the RGB LED with the hardware PWM of the Raspberry Pi
®
. Fortunately, the softPwm library simulates
PWM (softPwm) by programming.
RGB LEDs can be categorized into common anode type and common cathode type. In this experiment, the
latter is used.
Experiment
C Programming
1. Change directory:
cd/home/pi/IDUINO_SuperKit_C_code_for_RaspberryPi/05_RGB
2. Compile:
gcc rgb.c –o rgb –lwiringPi –lpthread
3. Run:
sudo ./rgb
Python Programming
1. Change directory:
cd/home/pi/IDUINO_SuperKit_Python_code_for_RaspberryPi/
2. Run:
sudo python 05_rgb.py
You should see the LED emit light of different colours.
You can also modify the parameters of the function ledColorSet() by yourself, then compile and run the code to
see the colour changes of the RGB LED.










