RGB LEDs

Greetings, everyone! This project delves into the fascinating world of RGB LEDs, or “Red Green Blue Light Emitting Diodes.” These unique LEDs offer a wide range of color options and can be used to create various lighting effects. Unlike traditional LEDs which only have two legs, RGB LEDs have four legs, as you can see in the illustration below. These additional legs allow for the control of each individual color, resulting in the ability to mix and match to create a vast array of hues. These versatile LEDs are commonly used in projects such as mood lighting, color-changing accents, and even in digital signage and displays. With their endless possibilities, RGB LEDs are a must-have for any maker or DIY enthusiast.

Typically, an LED has two legs: a positive leg (anode) and a negative leg (cathode). The positive leg is usually longer and is connected to the power source, while the negative leg is connected to ground.

When current flows through the LED, it causes the semiconductor material inside the device to emit light. The color of the light emitted by an LED depends on the materials used to make it.

In the case of RGB LEDs, it has 4 legs, where the additional legs are used to control the intensity of the red, green, and blue color individually, so the user can mix them to get the desired color.

Would you like to code along with me?

// Define Pins
#define BLUE 3
#define GREEN 5
#define RED 6

void setup()
{
pinMode(RED, OUTPUT);
pinMode(GREEN, OUTPUT);
pinMode(BLUE, OUTPUT);
digitalWrite(RED, HIGH);
digitalWrite(GREEN, LOW);
digitalWrite(BLUE, LOW);
}

// define variables
int redValue;
int greenValue;
int blueValue;

// main loop
void loop()
{
#define delayTime 10 // fading time between colors

redValue = 255; // choose between 1 and 255 to change color.
greenValue = 0;
blueValue = 0;


for(int i = 0; i < 255; i += 1) // fades out red bring green full when i=255
{
redValue -= 1;
greenValue += 1;


analogWrite(RED, redValue);
analogWrite(GREEN, greenValue);
delay(delayTime);
}

redValue = 0;
greenValue = 255;
blueValue = 0;

for(int i = 0; i < 255; i += 1) // fades out green bring blue full when i=255
{
greenValue -= 1;
blueValue += 1;

analogWrite(GREEN, greenValue);
analogWrite(BLUE, blueValue);
delay(delayTime);
}

redValue = 0;
greenValue = 0;
blueValue = 255;

for(int i = 0; i < 255; i += 1) // fades out blue bring red full when i=255
{
blueValue -= 1;
redValue += 1;

analogWrite(BLUE, blueValue);
analogWrite(RED, redValue);
delay(delayTime);
}
}

If you need help do not hesitate to ask, comment below or message me.

Trinket M0

Attention all ye tech enthusiasts! After much procrastination, I’ve finally decided to give my trusty little board a purpose and document my journey along the way. So, in the wee hours of the night, I embarked on a mission to conquer Adafruit’s Trinket M0. Thanks to the brilliant teaching of the one and only Lady Ada and her amazing written guide, after some time and research later, I emerged victorious and the Trinket now blinks through a rainbow of colors. I even snapped some photos and a video of the glorious code in action. Join me on this thrilling adventure as I master the Trinket and beyond!

Here is the code I used:

import board
import adafruit_dotstar as dotstar
import time

# Set up the Dotstar LED
led = dotstar.DotStar(board.APA102_SCK, board.APA102_MOSI, 1)

# Set the brightness of the led (Ranges from 0.0 to 1.0)
led.brightness = 1

while True:
	led[0] = (255, 0, 0)	# RGB value for color Red
	time.sleep(1)
	led[0] = (0, 255, 0)	# RGB value for color Green
	time.sleep(1)
	led[0] = (0, 0, 255)	# RGB value for color Blue
	time.sleep(1)

The above code can be saved in any text editor just be sure an save it as main.py and change the dropdown menu to all files (its usually in the bottom right corner of save menu when you save something).

Short notice camping trip

My lovely girlfriend and I decided to have a quick camping trip on our days off between work then might turn into a bi-weekly thing and adding videos on my youtube channel and breaking them down into a mini-series. Be on the lookout will have a promotion going on as well coming up on my channel!

YouTube Channel

Peace,

Shep

St. Patrick’s Day

Went to the fourth largest St. Patrick’s Day Parade in Dallas this last weekend is was pretty awesome p tons of people enjoying the show it was pretty awesome to watch.

Dallas Trip

Above is a view from the Omni hotel 14th floor, I think it looked absolutely amazing. Below are photos from Dallas, the aquarium and art museum.

There are so many more pictures to come this weekend I’m going back to Dallas for the St Patrick’s day parade.

Fixed my scheduling issue for posting this is off about two weeks, got it fixed and should be good now.

Next week.

Stay tuned for more post to come, pics of me in a kilt at St. Patrick’s Day Parade.

Hey Guy’s and Gal’s

Hi to all those reading, I’m going to be doing weekly post on Friday, on current topics or random craziness going on with me in life.

I’ve managed to find my self going through a very wonderful last few months in life and will be sharing what I have been doing myself and maybe it will help those of you that read this or just be your weekly dose of inspiration, either way I just want to spread the good in life.

Stay tuned next week and I will be showing my adventure in Dallas, TX small trip to the Dallas World Aquarium and the Dallas Museum of Art. As well as, my new weekly dose of inspiration for you folks.

Namaste,

Shep Barrick

Create a website or blog at WordPress.com

Up ↑

Design a site like this with WordPress.com
Get started