Arnov Sharma
Published © MIT

COLOR MIXER Version 2

A simple RGB Color Mixer for photography use, its powered by an Seeed XIAO M0 and uses three pots for controlling the colors.

BeginnerFull instructions provided1 hour88
COLOR MIXER Version 2

Things used in this project

Hardware components

Seeed Studio XIAO SAMD21 (Pre-Soldered) - Seeeduino XIAO
Seeed Studio XIAO SAMD21 (Pre-Soldered) - Seeeduino XIAO
×1
Adafruit ws2811
×1
SparkFun RGB leds SMD 5050 Package
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Seeed Studio Fusion PCB/PCBA
Seeed Studio Fusion PCB/PCBA

Story

Read more

Schematics

led board

control board

Code

code

C/C++
#include <Adafruit_NeoPixel.h>
#define NEOPIXELS 1
//#define LEDsPin = D3 ;  
const int LEDsPin = 3;

#include <Wire.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>

#define OLED_WIDTH 128
#define OLED_HEIGHT 64

#define OLED_ADDR   0x3C

Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT);

const int redPotPin = 2;      
const int greenPotPin = 0;   
const int bluePotPin = 1;  

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);
  display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR);
  display.clearDisplay();  
  Serial.begin(9600);

}
void loop() {
  display.clearDisplay();
  
  redPotValue = analogRead(redPotPin);
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0, 0);
  display.println("BLUE=");   //RED=
  display.setCursor(50, 0);
  display.println(redPotValue);



  
  greenPotValue = analogRead(greenPotPin);
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0, 20);
  display.println("RED=");   //GREEN=
  display.setCursor(50, 20);
  display.println(greenPotValue);


 
  
  bluePotValue = analogRead(bluePotPin);
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0, 43);
  display.println("GREEN=");  //BLUE=
  display.setCursor(50, 43);
  display.println(bluePotValue);
  display.display();

  
 
  delay(50);
 
  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

Arnov Sharma

269 projects • 279 followers
Just your average MAKER

Comments