edison science corner
Published © CC BY-SA

RGB LEDCUBE Using NEOPIXEL LEDs and PCB

let's build an RGB LED CUBE using NEOPIXELS and PCB

AdvancedFull instructions provided5 hours1,810
RGB LEDCUBE Using NEOPIXEL LEDs and PCB

Things used in this project

Hardware components

Arduino Pro Mini 328 - 5V/16MHz
SparkFun Arduino Pro Mini 328 - 5V/16MHz
×1
ws2812 led
×1
JLCPCB Customized PCB
JLCPCB Customized PCB
×1
tp4056 charging module
×1
Rechargeable Battery, 3.7 V
Rechargeable Battery, 3.7 V
×1
PTS 645 Series Switch
C&K Switches PTS 645 Series Switch
×1
Slide Switch
Slide Switch
×1

Software apps and online services

Arduino IDE
Arduino IDE
EasyEDA
JLCPCB EasyEDA
jlcpcb

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires

Story

Read more

Custom parts and enclosures

stl files

stl files

Schematics

circuit diagram

Code

code

C/C++
#include <FastLED.h>
#define NUM_LEDS 64 
#define DATA_PIN 9
#define CLOCK_PIN 13

CRGB leds[NUM_LEDS];

void setup() { 
	Serial.begin(57600);
	Serial.println("resetting");
	FastLED.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS);
	FastLED.setBrightness(84);
}

void fadeall() { for(int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(250); } }

void loop() { 
	static uint8_t hue = 0;
	Serial.print("x");
	// First slide the led in one direction
	for(int i = 0; i < NUM_LEDS; i++) {
		// Set the i'th led to red 
		leds[i] = CHSV(hue++, 255, 255);
		// Show the leds
		FastLED.show(); 
		// now that we've shown the leds, reset the i'th led to black
		// leds[i] = CRGB::Black;
		fadeall();
		// Wait a little bit before we loop around and do it again
		delay(10);
	}
	Serial.print("x");

	// Now go in the other direction.  
	for(int i = (NUM_LEDS)-1; i >= 0; i--) {
		// Set the i'th led to red 
		leds[i] = CHSV(hue++, 255, 255);
		// Show the leds
		FastLED.show();
		// now that we've shown the leds, reset the i'th led to black
		// leds[i] = CRGB::Black;
		fadeall();
		// Wait a little bit before we loop around and do it again
		delay(10);
	}
}

Credits

edison science corner

edison science corner

56 projects • 67 followers
Electronic enthusiast watch videos from here https://www.youtube.com/channel/UCVcOsUBmH4hzVSnmJA_i5SA

Comments