Arduino LED light strip project
#include <Adafruit_NeoPixel.h>
// the data pin for the NeoPixels
int neoPixelPin = 5;
// How many NeoPixels we will be using, charge accordingly
int numPixels = 180;
// Instatiate the NeoPixel from the ibrary
Adafruit_NeoPixel strip = Adafruit_NeoPixel(numPixels, neoPixelPin, NEO_GRB);
// Global RGB values, change to suit your needs
int r = 0;
int g = 0;
int b = 255;
void setup() {
strip.begin(); // initialize the strip
strip.show(); // make sure it is visible
strip.clear(); // Initialize all pixels to 'off'
}
void loop() {
// set the colors for the strip
for( int i = 0; i < numPixels; i++ ){
strip.setPixelColor(i, i, 255 - i, 0);
strip.show();
delay(10);
}
// show all pixels
// wait for a short amount of time -- sometimes a short delay of 5ms will help
// technically we only need to execute this one time, since we aren't changing the colors but we will build on this structure
delay(10);
strip.clear();
}
Monday - 2024-10-07
Over this last weekend I was playing with the Arduino IDE strip light software and ran into a few snags. I didn't realize that the USB port I was using was so critical. So I got home from class after not getting much of a chance to experiment with the light strip because we spent the whole class trying to make it work, and only solving it in time before class was over.
So I got home and immediately lit up the laptop again and went to continue where I left off before taking a load off for the night and I plugged the board in and got one error after another. It kept telling me that there was a fatal esptool.py error, that it couldn't open COM5, file not found, error none2)esptool.py v3.0. I had been trying this for a while with many attempts so a variety of errors were displayed.
I played with it on and off for an hour or so, going to Device Manager (this is Win11) to look at ports and tried changing ports in the IDE software under TOOLS/PORT:/ (of which I had 5 selected), and after taking more breaks I finally tried different USB ports. I had no idea it was port specific. Apparently I just glossed right over setting this specific port up to communicate with the Arduino in the first place. And so I had no idea that when it was talking about ports, it meant physical USB ports. For some reason, I had it in my head that there are like logical ports that needed to be switched around for some reason. I must have been going over Firewall ports recently or something. But to be fair, when looking at things like Serial ports and Universal Serial ports in Device Manager, a lot of the time it seems to me to be very logical like in a virtual sense rather than physically literal. I mean you're dealing with drivers and stuff like that. Just go with it, I'm a dummy, whatever!
If you set up a strip light and a board to work with the Arduino IDE software, keep in mind which port you're using physically because it needs to keep using that port in the software unless you change the port. I did make the mistake of changing the port to port 2 and 3 and 4 before changing what physical USB port I was using and this caused a little extra confusion for a few seconds till I realized, oh yeah, I changed it. I was actually lucky that I just happened to plug the board into the correct USB port the second time around and then checked the ports after a few minutes and saw that port 5, which had disappeared since I had left class, had no reappeared and so I clicked it and pressed the upload button.
This has been Truncat3d 00000000111100010100110______________end of line
No comments:
Post a Comment