Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Arnov Sharma
Published © LGPL

RGB Mixinator V2

DIY Color Mixer that uses an Arduino Nano with few WS2812B LEDs

BeginnerFull instructions provided1 hour540

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
NeoPixel Ring: WS2812 5050 RGB LED
Adafruit NeoPixel Ring: WS2812 5050 RGB LED
×1
PCBWay Custom PCB
PCBWay Custom PCB
×1

Software apps and online services

Fusion
Autodesk Fusion

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Attachment

Schematics

sch

Code

code

C/C++
#include <Adafruit_NeoPixel.h>
#define NEOPIXELS 10 
#define LEDsPin 3   
const int redPotPin = A0;      
const int greenPotPin = A1;   
const int bluePotPin = A2;  
int redValue = 0; 
int greenValue = 0; 
int blueValue = 0; 
int redPotValue = 0; 
int greenPotValue = 0; 
int bluePotValue = 0; 

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NEOPIXELS, LEDsPin, NEO_GRB + NEO_KHZ800);
void setup() {
  pinMode(LEDsPin, OUTPUT);
  pinMode(redPotPin, INPUT);
  pinMode(greenPotPin, INPUT);
  pinMode(bluePotPin, INPUT);
}
void loop() {
  redPotValue = analogRead(redPotPin);
  delay(5);
  greenPotValue = analogRead(greenPotPin);
  delay(5);
  bluePotValue = analogRead(bluePotPin);
  redValue = map(redPotValue, 0, 1023, 0, 255);
  greenValue = map(greenPotValue, 0, 1023, 0, 255);
  blueValue = map(bluePotValue, 0, 1023, 0, 255);;
 
   for (int i = 0; i < NEOPIXELS; i++) {
    
    pixels.setPixelColor(i, pixels.Color(redValue, greenValue, blueValue));
    pixels.show(); 
    delay(50); 
  }
}

Credits

Arnov Sharma
321 projects • 327 followers
Just your average MAKER
Contact

Comments

Please log in or sign up to comment.