solilover.blogg.se

Arduino rgb led chasing led bitread example
Arduino rgb led chasing led bitread example













const int red_A_Pin = 3 // the pin numbers for the 1st LED One way to achieve what you want is to change the setColor() function to accept pin numbers as parameters then pass in the pin numbers of the LED you would like to change. Note to mods - I'm fairly confident I have the right section of the forum, if not please feel free to move my post. Thank you for your time and any help / advice you are willing to give. I am using an Arduino Uno, resistors and LED - RGB clear common anode I have tried adding A and B like this: setColor_A or setColor_B bu I get error messagesĬould someone point me in the right direction please I'm guessing it will be something which defines A and B leds somehow. I think the part of the coding I need to change is this part:īut I do not know what I need to be using. What I would like to achieve is RGB_A to be BLUE while RGB_B would be RED. At present they are both running the same cycle of colours albeit not in sync but that is irrelevant. What I would like to do now is to separate the two RGB leds so they both do something different. Void setColor(int red, int green, int blue) uncomment this line if using a Common Anode LED Here is the code I am using to achieve this so far:Ĭonst int red_A_Pin = 3 // the pin numbers for the 1st LEDĬonst int red_B_Pin = 11 // the pin numbers for the 2nd LED

arduino rgb led chasing led bitread example

This has been successful in getting BOTH leds to cycle through the colours using the six pwm pins, goal one achieved.

arduino rgb led chasing led bitread example

Using the basic programming for one RGB led and also some coding from the 'several things at once' example I have compiled the code below. While I can successfully control / program one RGB led with colours, fades delays etc I now would like to move to controlling two RGB leds so each is independent of each other. I have read through a few basic examples such as 'blink' and one on RGB LED.

#Arduino rgb led chasing led bitread example how to#

I am totally new to Arduino and am loving learning how to do things. First off, thank you for taking the time to offer your advice and helping me out.













Arduino rgb led chasing led bitread example