Here's the Arduino code!
// LED color interpreter
// Made by Thomas Burns
// www.thomasburns.net
// last revised: 04/12/2020
#include <adafruit_neopixel.h>
#include <wire.h>
#include <liquidcrystal_i2c.h>
int red, green, blue = 0;
// I2C pins declaration
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIN 2
#define NUMPIXELS 10
// Initialize the neopixel strip
Adafruit_NeoPixel strip(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
// Set the pins connected to the potentiometer as inputs
pinMode(A0, INPUT);
pinMode(A2, INPUT);
pinMode(A3, INPUT);
// LCD
lcd.begin(16, 2);
lcd.backlight();
delay(1000);
// AV test
strip.begin();
strip.show(); // Initialize all pixels to 'off'
// magenta chase
for (int i=0; i<=9; i++) {
strip.setPixelColor(i, 56, 11, 69);
strip.show();
delay(50);
}
// yellow chase
for (int i=0; i<=9; i++) {
strip.setPixelColor(i, 85, 48, 12);
strip.show();
delay(50);
}
// cyan chase
for (int i=0; i<=9; i++) {
strip.setPixelColor(i, 56, 100, 100);
strip.show();
delay(50);
}
// clear LEDs
for (int i=0; i<=9; i++) {
strip.setPixelColor(i, 0, 0, 0);
strip.show();
delay(50);
}
delay(200);
lcd.setCursor(0,0);
lcd.print("Good");
delay(100);
lcd.setCursor(0,0);
lcd.print("Good evening,");
delay(500);
lcd.setCursor(0,1);
lcd.print("Thomas.");
delay(2000);
lcd.clear();
delay(500);
// print static text in setup to prevent flicker
lcd.setCursor(0, 0);
lcd.print("Red 0");
lcd.setCursor(8, 0);
lcd.print("Grn 0");
lcd.setCursor(0, 1);
lcd.print("Blue 0");
}
void loop() {
// Read and store the potentiometer values
// We are scaling them from a 10bit scale to an 8 bit scale
red = analogRead(A0) >> 2; // 10 to 8 = shift two bits
green = analogRead(A2) >> 2;
blue = analogRead(A3) >> 2;
// set colors of all the eight neopixles
for (int pixel = 0; pixel < 16; pixel++)
{
strip.setPixelColor(pixel, red, green, blue);
}
strip.show();//Update the strip with new color values
delay(50);
// LCD code
lcd.setCursor(4, 0); // move cursor just behind the static word "RED "
lcd.print(" "); // 3 spaces to clear previous value
lcd.setCursor(4, 0); // back to pos 5 again
lcd.print(red); // print value
lcd.setCursor(13, 0);
lcd.print(" ");
lcd.setCursor(12, 0);
lcd.print(green);
lcd.setCursor(5, 1);
lcd.print(" ");
lcd.setCursor(5, 1);
lcd.print(blue);
}
Thomas
Sagar 001
dBSound Bracelet
cafelizardo
Can you please share the BOM and schematic files? Thanks!