Scrap Stir Plate
Necessitated a stir plate for the delicate task of a perfect sweet iced tea?



Ingredients
Arduino Uno
Linear Softpot
Neopixels Strip
4.7K + 1K Resistor
1000uf Capacitor
80mm Fan
(2) Neodymium Magnets
9V Power Supply



#include <Adafruit_NeoPixel.h>
#define PIN 6
Adafruit_NeoPixel strip = Adafruit_NeoPixel(8, PIN, NEO_GRB + NEO_KHZ800);

int p = A0;
int v;
int s;
int h;
int x;
int r;
int g;
int b;

void setup() {
strip.begin();
strip.show();
delay(100);
for (x = 0; x < 1000; x++) {
s = map(analogRead(p), 0, 1024, 0, 255);
}
s = s / 1000;
h = s - 3;
s = s + 3;
colorWipe(strip.Color(0, 0, 255), 50);
}

void loop() {
v = map(analogRead(p), 0, 1024, 0, 255);
if (v >= h && v <= s) {
// ignore empty pot
} else {
if (v <= 42.5) {
r = 255;
g = v * 6;
b = 0;
} else if ((v > 42.5) && (v <= 85)) {
r = 255 - (v - 43) * 6;
g = 255;
b = 0;
} else if ((v > 85) && (v <= 127.5)) {
r = 0;
g = 255;
b = (v - 85) * 6;
} else if ((v > 127.5) && (v <= 170)) {
r = 0;
g = 255 - (v - 127.5) * 6;
b = 255;
} else if ((v > 170) && (v <= 212.5)) {
r = (v - 170) * 6;
g = 0;
b = 255;
} else if ((v > 212.5) && (v <= 255)) {
r = 255;
g = 0;
b = 255 - (v - 212.5) * 6;
}
colorWipe(strip.Color(r, g, b), 50);
}
delay(5);
}

void colorWipe(uint32_t c, uint8_t ) {
for (uint16_t i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
}
}


@VijeMiller
KE=½mv²