PRODUCTS

fading rgb led (arduino)

by:IPON LED     2020-05-11
In this Instructable I will show you how to make a simple faded RGB Led.
It can be used as a good night light or mood lighting.
To do this, you need :-an Arduino (
I am using Arduino UNO R3 but others can use it as well)-an RGB Led (
I use a common anode, and the common cathode can also be used)-a Breadboard-some wire-
2 resistors 180 ohms (
Brown, gray, brown, gold)-
1 Resistance 330 ohms (
Orange, brown, gold)
The schematic diagram is simple.
If you have a co-melt anode led (like i do)
If you have a co-cathode led, just connect it to 5 v.
Connect the other 3 leads to the 3 PWM pins on the arduino with a resistor (
Value depends on led).
The code is a bit difficult but quite simple.
This code is only for co-anode LEDs.
If you want to use it for a co-cathode LEDs, you have to change all the \"analogy\" lines to \"analogy \"(
No \"255-\")
So it should work (
I have not tested).
Define Green 3 define Blue 5 define Red 6 define delay time 20void pinM digitalW}int redVal; int blueVal; int greenVal; Void analogW}
Greenvale-Ralph Bluff= 1;
AnalogW analogW}
Blue Eagle-Blue Eagle= 1;
AnalogW analogW}}
Expand/modify/improve/With your imagination /. . . the project.
Show your work in the comments, please let me know what you think of this note as this is my first note.
Also please correct me if I make any mistakes.
Custom message
Chat Online 编辑模式下无法使用
Chat Online inputting...