sk6812 rgbw basic program trouble

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
grettagirl
 
Posts: 68
Joined: Mon Oct 31, 2022 5:39 pm

sk6812 rgbw basic program trouble

Post by grettagirl »

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

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: sk6812 rgbw basic program trouble

Post by adafruit_support_bill »

If you post the code you are having trouble with and describe what is not working as expected, we can try to help.

User avatar
grettagirl
 
Posts: 68
Joined: Mon Oct 31, 2022 5:39 pm

Re: sk6812 rgbw basic program trouble

Post by grettagirl »

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/

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: sk6812 rgbw basic program trouble

Post by adafruit_support_bill »


User avatar
grettagirl
 
Posts: 68
Joined: Mon Oct 31, 2022 5:39 pm

Re: sk6812 rgbw basic program trouble

Post by grettagirl »

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

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: sk6812 rgbw basic program trouble

Post by adafruit_support_bill »

i ran code, 6 are changing and flashing.
The code is for a strip with 7 pixels. If you want to control 16, you need to modify the code accordingly.
other 10 are solid red, colors are not same as code.
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-use
i need simple code that i can tweak to learn/
It doesn't get much simpler. I'd suggest reading through the uberguide. Especially this page.

User avatar
grettagirl
 
Posts: 68
Joined: Mon Oct 31, 2022 5:39 pm

Re: sk6812 rgbw basic program trouble

Post by grettagirl »

Thanks, I already tried linked tutorial on setting single led. Did not work. Bummed. I will keep tying to find a solution

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: sk6812 rgbw basic program trouble

Post by adafruit_support_bill »

If you post the code you are having trouble with and describe what is not working as expected, we can try to help.

User avatar
grettagirl
 
Posts: 68
Joined: Mon Oct 31, 2022 5:39 pm

Re: sk6812 rgbw basic program trouble

Post by grettagirl »

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();

}

User avatar
grettagirl
 
Posts: 68
Joined: Mon Oct 31, 2022 5:39 pm

Re: sk6812 rgbw basic program trouble

Post by grettagirl »

ran code and got this error. Compilation error: 'strip' does not name a type

User avatar
grettagirl
 
Posts: 68
Joined: Mon Oct 31, 2022 5:39 pm

Re: sk6812 rgbw basic program trouble

Post by grettagirl »

used tutorial, not sure what is going on

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: sk6812 rgbw basic program trouble

Post by adafruit_support_bill »

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.

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();

}

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”