Upload files to "BareBones"

BareBones Code Commit
This commit is contained in:
krishmo118 2025-02-26 20:21:58 +00:00
parent ccb0410c05
commit f4fbb400d1
1 changed files with 40 additions and 0 deletions

40
BareBones/barebones.ino Normal file
View File

@ -0,0 +1,40 @@
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 300
//defining locations of pins
#define DATA_PIN 2
#define BUTTON_PIN 4
// Define the array of leds
CRGB leds[NUM_LEDS];
//assigning locations of pins
int buttonPin = 8;
int ledPin = 13;
void setup() {
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
Serial.begin(115200);
pinMode(BUTTON_PIN, INPUT_PULLUP); //use internal pullup resistor
} //void setup
void loop() {
// Move a single LED down the strip
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Red; // Set the current LED to red
FastLED.show(); // Display the updated LED colors
//delay(0.001); // Wait for 100 milliseconds
delayMicroseconds(100);
leds[i] = CRGB::Black; // Turn off the current LED
FastLED.show(); // Update the strip
}
}