I was already pretty sure of that.
but thanks for verifying it for me!
finally got this hooked up to my garage computer (different than this one).
I'm using a 9V battery to power both the Arduino Uno and the LED strip. I hooked the 9V to the Vin and GRND pins on the Arduino and the LED strip to the GRND and 5V pins.
one thing I specifically wanted and am not getting is for all LED's to stay lit once turned on. also, it will go 27 LED's then turn them off and restart. I even set NUM_LEDS to 88. (but I don't have 88 LED's)
one, I don't have any idea why it won't go the full length of the strip.
and, two, I don't know how to get it to leave the lights on. maybe I shouldn't be using 'loop'.
how would I tell it to hold with all LED's on once it lights all of them in sequence?
Sounds like a power issue for the Uno, which is experiencing brown-out (and restarting). How is the Uno getting 9vdc? How are the NeoPixels getting their required voltage? Your code works. The problem is in the hardware configuration.
Your code does that by not changing the colors (values in the buffer), and keeps writing "white" over the existing "white."
My guess is the power supplied to the Arduino and NeoPixel is insufficient. Would you show all the devices you are using, and their interconnection?
It never will works this way. Arduino is not power regulator from 9 to 5v. You need an external voltage regulator module to convert 9v to 5v and than feeds your leds and arduino with 5v.
Also take in account that standard 9v "smoke detector" battery is very weak and probably will empty in half of hour.
on the Arduino website when looking for ways to power the Arduino and LED strip, it said that I could hook up a 9V battery in just the way I have it connected. where the LED strip is connected, I get 5 volt as it is regulated to 5V from the 9V input.
also, I am using 9600mah 9V batteries.
Ok, you always know things better than your helpers.
Good lucks to your project.
I think that reference is for a small number of NeoPixels. Remember, one neopixel is made of three LEDs. Each LED sinks 20mA... so one NeoPixel sinks 60mA at full-white (RGB @ 255, 255, 255).
The Arduino is to only source a maximum of 40mA per pin, with an accumulative current draw from all pins of 100mA.
Here is a drawing of a few ways to connect NeoPixels. Use the "long strip" method always, and you will have no problems with your neopixel projects.
Please, give "long strip" a try and post your results.
I hooked up wires all the way to the end of the strip (and actually counted for the first time - 78 LED's) with the program set to 88 LED's, it went as far as 67 then stopped and started over. so I set it to 65, and it went to 52 and started over. OK, I set to 40 and it went to 36 and started over. Fine then, I set it to 20 and it went to 15!
pretty sure I do need to add more power inputs along the strip, but still confused as to why it doesn't go as far as what was in the program.
Too dense or too lazy? There's a difference.
As Massimo Banzi (co founder of Arduino) wrote in Getting Started With Arduino (2015), pg 31: "Arduino is not for quitters". If I can do Arduino, you can too.
now I have a different problem.
I brought the stuff in as it's over 90 in the garage, hooked up to my main computer and somehow it doesn't recognize that it is plugged in. the Arduino program claims there are no ports on my computer even though I have one that I have plugged the board into. I even tried a different A to B USB cord.
where did the 'too dense' come from?
Post # 7:
I always have receipts ![]()
Let's focus on getting the job done. You've got this. ![]()
I have been able to get halfway there.
I have the LED's turning on in sequence.
just don't know yet how to have them stay on once all are lit.
(you went a ways back for that 'too dense' part.
What about stuffing your desired result into a state machine? This was a huge revelation for me, the switch/case control structure. It's like a video game: choose single player, multiplayer, DLC, whatever. Whatever it is that switches the state of your led functions, use it to drive the result into whatever you want. I have used this to drive a bunch of discrete states by using char input into serial to pick from as many different, in my case, GI Joe file cards as read in another program.
Your code in post #45 is taken right from Adafruit, which is cool, (I've done it too) but you have to learn the control structures (forget if/else most of the time, switch/case is where it's at) and millis() timing (forget delay, almost all the the time. millis() is better)
state machine?
One of the gurus in the forum @J-M-L (I am not one) posted this:
https://forum.arduino.cc/t/yet-another-finite-state-machine-introduction/1198997
and it's excellent. I learned a lot through this explanation.
Consider the following example (no equipment required). Here the thing that drives the machine is just a repeating timer and it increments a sequencer that eventually resets:
byte level;
unsigned long currentTime;
unsigned long lastTimeAround;
void setup() {
Serial.begin(115200);
Serial.println("millisTimedFunctionsByKatie");
delay(500);
Serial.println();
level = 0;
currentTime = 0;
lastTimeAround = 0;
}
void loop() {
// start free running timer
currentTime = millis();
// set timer whose condition is to check level every 2 seconds
if (currentTime - lastTimeAround > 2000) {
switch(level) {
case 0:
zero();
break;
case 1:
one();
break;
case 2:
two();
break;
case 3:
three();
break;
case 4:
four();
break;
}
// synch the time marker to the free running clock
lastTimeAround = currentTime;
}
}
void zero() {
Serial.print("\tKatie ");
level += 1;
}
void one() {
Serial.print("Loves ");
level += 1;
}
void two() {
Serial.print("Cats ");
level += 1;
}
void three() {
Serial.print("and ");
level += 1;
}
void four() {
Serial.println("Dogs:)");
Serial.println();
level = 0;
}
yours (although it is a ring) will leave the pixels on once all are lit. mine does not. I looked and looked at your programming and cannot find any difference.
any ideas?

