New to this

Hi, I am trying my hardest to find the raw code to learn Arduino for LED lights. I see samples, and codes that do not compile when I copy it over. I have looked for books to help learn and they only have non addressable programming codes. I just want to know if I can just get the raw codes somewhere something that shows me how to turn on a light, how to program the lights to a specific colour. I would like something that makes it so I can see what it does and put it together.

I get so frustrated getting samples that work, but do not do anything remotely close to what I would like it to do. Please help someone new understand how to do my project.

Did you see these two links? http://playground.arduino.cc/ https://www.arduino.cc/en/Tutorial/HomePage?from=Main.LearnArduino How about a description of your intended project.

756E6C: Did you see these two links? http://playground.arduino.cc/ https://www.arduino.cc/en/Tutorial/HomePage?from=Main.LearnArduino How about a description of your intended project.

for a cosplay I am making a wizard staff, I have the intention of having two buttons, button A turns the staff Red, button B would turn the staff a pale green colour. I will look into your links, thank you for the help

What kind of LED lights do you have? It sounds like you have addressable LEDs. I have had good luck with the FastLED library.

The best place to start with any library is the example code that comes with it. If there are no samples that correspond to what you want to do the trick is to pick what you need from different examples and put it together in one program.

Assuming you have addressable LEDs and want to use the FastLED library, run the blink example. All it does is turn one LED red and then shut it off (set color to black) over and over.

If you changed it to turn all the LEDs red then turn them to green instead of black you'd be most of the way toward your project. You would only need to alter the code to change color on a button press instead of continuously.

BTW, without knowing more about your project it seem as though you could have just one button that toggles between red and green.

blackrigante:
codes that do not compile when I copy it over

If you actually wanted help with that you’d need to provide more information. When you encounter an error you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

But I agree with Blue Eyes’ advice. If you’re using addressable LEDs install the FastLED library, play with the included examples, which will be found at File > Examples > FastLED after installing the library until you understand how to use the library. You can find more information at:

blackrigante: for a cosplay I am making a wizard staff, I have the intention of having two buttons, button A turns the staff Red, button B would turn the staff a pale green colour. I will look into your links, thank you for the help

Do you have the LEDs yet? There are two quite different ways to do this: you can use RGB LEDs and power them from PWM pins, or you can use addressable LEDs (eg: adafruit neopixels) and talk to them with a library. Which method you use depends on what hardware you are using.