I am very new to programming leds. I am using Ardruino Uno. I have ran a strand test through neo pixel library and everything is working properly. My problems begin when i try to write code to a single led or groups. Can someone send me simple code so i can see an example of addressing each individual led so i can determine if i have strip set up properly. There are 16 leds on strip. Almost all codes example i have copied and ran are for rgb and i get either errors or leds are not showing proper colors.
Please help Michael
sk6812 rgbw basic program trouble
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: sk6812 rgbw basic program trouble
If you post the code you are having trouble with and describe what is not working as expected, we can try to help.
- grettagirl
- Posts: 68
- Joined: Mon Oct 31, 2022 5:39 pm
Re: sk6812 rgbw basic program trouble
Hello Bill,
can you give me a link where i can copy an upload basic code examples to run? Most the ones i can run successfully are way to complex for me to understand and i need simple code that i can tweak to learn/
can you give me a link where i can copy an upload basic code examples to run? Most the ones i can run successfully are way to complex for me to understand and i need simple code that i can tweak to learn/
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: sk6812 rgbw basic program trouble
This one is fairly simple: https://learn.adafruit.com/neopixel-tiara/overview
- grettagirl
- Posts: 68
- Joined: Mon Oct 31, 2022 5:39 pm
Re: sk6812 rgbw basic program trouble
i ran code, 6 are changing and flashing. other 10 are solid red, colors are not same as code. I need code that is simpler to trouble shoot . Code to light one led ton strip? seems like most code samples are too complex to grasp basic concept
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: sk6812 rgbw basic program trouble
The code is for a strip with 7 pixels. If you want to control 16, you need to modify the code accordingly.i ran code, 6 are changing and flashing.
The code is for RGB. Since you are using an RGB strip, you need to declare it as such. This is covered in the guide: https://learn.adafruit.com/adafruit-neo ... ibrary-useother 10 are solid red, colors are not same as code.
It doesn't get much simpler. I'd suggest reading through the uberguide. Especially this page.i need simple code that i can tweak to learn/
- grettagirl
- Posts: 68
- Joined: Mon Oct 31, 2022 5:39 pm
Re: sk6812 rgbw basic program trouble
Thanks, I already tried linked tutorial on setting single led. Did not work. Bummed. I will keep tying to find a solution
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: sk6812 rgbw basic program trouble
If you post the code you are having trouble with and describe what is not working as expected, we can try to help.
- grettagirl
- Posts: 68
- Joined: Mon Oct 31, 2022 5:39 pm
Re: sk6812 rgbw basic program trouble
I''m going to take another stab at this. I'm using a sk6812 rgbw strip with 16 leds. Im applying color to 7 an10 led.
Im away from ardruino right now so i can not test. Can you take a quick look and see if everything is there? Thanks Michael
#include <Adafruit_NeoPixel.h>
#define LED_PIN 6
#define LED_COUNT 16
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
strip.setPixelColor(7, 0, 60, 0, 50);
strip.setPixelColor(10, 0, 255, 0, 127);
strip.show();
}
Im away from ardruino right now so i can not test. Can you take a quick look and see if everything is there? Thanks Michael
#include <Adafruit_NeoPixel.h>
#define LED_PIN 6
#define LED_COUNT 16
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
strip.setPixelColor(7, 0, 60, 0, 50);
strip.setPixelColor(10, 0, 255, 0, 127);
strip.show();
}
- grettagirl
- Posts: 68
- Joined: Mon Oct 31, 2022 5:39 pm
Re: sk6812 rgbw basic program trouble
ran code and got this error. Compilation error: 'strip' does not name a type
- grettagirl
- Posts: 68
- Joined: Mon Oct 31, 2022 5:39 pm
Re: sk6812 rgbw basic program trouble
used tutorial, not sure what is going on
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: sk6812 rgbw basic program trouble
You might want to start at ground zero and learn about Arduino programs. https://create.arduino.cc/projecthub/li ... cti-f5fb2c
In addition to your setup() function, you need to have a loop() function.
In addition to your setup() function, you need to have a loop() function.
Code: Select all
#include <Adafruit_NeoPixel.h>
#define LED_PIN 6
#define LED_COUNT 16
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop()
{
strip.setPixelColor(7, 0, 60, 0, 50);
strip.setPixelColor(10, 0, 255, 0, 127);
strip.show();
}
Please be positive and constructive with your questions and comments.