[SOLVED] Can you see what I am doing wrong trying to address arrays?

I hope not still. In case:

      pixels.setPixelColor(i, pixels.Color(0, 150, 0));

sets the pixel at index i to ~60 percent green.

If in real life it looks blue, or red, the way to fix that is to change the constant passed as

Argument 3 = Pixel type flags

because it means you lied were mistaken about the RGB order that particular type of neopixel uses.

You could fix it by changing the setPixelColor() method call, but those may be many scattered all over you code, and doing would only work for that strip type and anyone using your code would have to change it all over the place.

The documentation is clear

void setPixelColor (uint16_t n, uint8_t r, uint8_t g, uint8_t b);

Set a pixel's color using separate red, green and blue components.

HTH

a7

Thanks Paul, that works now.
I will get on and try to get it to give me all 10 numbers as I ask for them.
I feel sure I will be back for more advice :slightly_smiling_face:

Feel better than people? You can call me a lot of things but don't call me a liar. I'm the first person to admit I'm no professional in electronics. I have never taken a single class in anything related to electronics or computer programming; I have no industry credentials, training or experience in industrial automation, design or building.
I am the first to admit that I'm a hobbyist, I make tons of mistakes when I program and build electronic devices and my experience is limited to what time and personal finances reasonably allow over the last 10 years. I'm just picking up this hobby again after about a year of really immersing myself in it and after you walked back what you seemed to want to imply about my character, yes, you are correct:
I made a mistake.
In all my stuff that uses Neopixels, indeed, it is formatted as you state. GRB.
I thought Arduino is primarily aimed at non professionals and hobbyists and that this forum is supposed to be helpful and maybe even fun. I try to be helpful and enjoy chatting about these topics with others like you, and hope to learn more and if possible help others learn and get over their project stumbling blocks.
I respect your knowledge, which seems to be much greater than mine in this hobby, and the time you take to offer assistance to others, but let's keep it fun, ok?
Don't call me a liar.

I know that you didn't. I assume that I quoted it from the wrong place. Sorry

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.