Something went wrong. Try again.
A portable split keyboard
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243#include <Arduino.h>#include <NeoPixelBus.h>
#define PIN D3#define NUMPIXELS 3
NeoPixelBus<NeoGrbFeature, NeoEsp8266Uart1800KbpsMethod> strip(NUMPIXELS, PIN);
float hue[NUMPIXELS] = {0, 0, 0};float sat[NUMPIXELS] = {0, 0, 0};float bri[NUMPIXELS] = {0, 0, 0};
float hueSpeed[NUMPIXELS] = {1.0, 1.01, 1.025};float satSpeed[NUMPIXELS] = {0.9, 0.95, 1.0};float briSpeed[NUMPIXELS] = {0.95, 1.0, 1.05};
void setup() { strip.Begin(); strip.Show();}
void loop() { for(int i = 0; i < NUMPIXELS; i++) { hue[i] += hueSpeed[i]; sat[i] += satSpeed[i]; bri[i] += briSpeed[i];
if(hue[i] >= 360) hue[i] = 0; if(sat[i] >= 360) sat[i] = 0; if(bri[i] >= 360) bri[i] = 0;
float h = hue[i] / 360.0; float s = 0.5 + (sin(sat[i] * PI / 180.0) * 0.25); float b = 0.45 + (sin(bri[i] * PI / 180.0) * 0.25);
HsbColor color(h, s, b); strip.SetPixelColor(i, color); }
strip.Show(); delay(20);}