Arduino Example RGB LED
This example demonstrates how to use the Azande Library together with a RGB LED.
The LED has one "level-pin" for each color Red(R), Green(G), Blue(B).
Each pin is supplied with a PWM with the function analogWrite(...).
The PWM duty 0-100% is represented by a value ranging 0-255.
In this example you can set each "color-level" individually from Azande Studio.
You can also select one of the predefined colors: Black, White, Red, Green, Blue and Yellow.
The the predefined colors are a combination of R, G and B values.
RGB LED
Features
The following Feature Types are used.
- Command Enum Feature: With the command "Set Color" the user can select one of the predefined colors.
- For each color:
- Command Int32 Feature: The command "color" sets the "color-level".
- Event Int32 Feature: The event "color" shows current "color-level". By setting range (0-255) the Feature Panel will be a Gauge in Azande Studio.
- Command Enum Feature: The command "Adjust xxx" is a set of adjustments user can apply on the "color-level".
The circuit
RGB LED |
Arduino Board |
||
Pin |
Pin |
Type |
Comment |
R |
Digital Pin 9 |
Output PWM |
Use pin that support analogWrite. On board pins with '~' symbol. |
G |
Digital Pin 10 |
Output PWM |
Use pin that support analogWrite. On board pins with '~' symbol. |
B |
Digital Pin 11 |
Output PWM |
Use pin that support analogWrite. On board pins with '~' symbol. |
Gnd |
GND |
Supply |
Azande Studio View
Downloads
The example is included in the Arduino Library.
Click here to access download of the Arduino Library