Sunday, July 20, 2014

GPIO 04-rgb

I finally got to the RGB LED and tried to connect it to Raspberry PI.
This first script (04-rgb.sh) is a modification of previous one. It uses one new feature though, associative fields in bash to distinguish between the three basic colors (RGB) and their combinations (Yellow, Purple, Light Blue, White) as shown on the figure:


The following figure shows how the LED is connected to GPIO.



This script handles only two states of color, however. It can combine 2 or more colors, but only at their full intensity. Next scripts will use PWM (pulse width modulation) to increase the granularity option to control each color more precisely.


No comments:

Post a Comment