Тема: RGB КОЛЬЦО - ЧАСЫ
#include <Adafruit_NeoPixel.h>
#include <Wire.h>
#include <DS3231.h>//https://github.com/jarzebski/Arduino-DS3231/archive/master.zip
DS3231 clock;
RTCDateTime DateTime;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(12, 2, NEO_GRB + NEO_KHZ400);// 4 трека, D6
byte i,s,m,h,mm,sm,sh,mh;
unsigned long t;
void setup(){
strip.begin();Wire.begin(); clock.begin();
// clock.setDateTime(__DATE__, __TIME__);
}
void loop(){
DateTime=clock.getDateTime();
s = DateTime.second/5;
m = DateTime.minute/5;
h = DateTime.hour;
if(h>11){h=h-12;}
if(s==m){sm=10;}else{sm=0;}
if(s==h){sh=10;}else{sh=0;}
if(m==h){mh=10;}else{mh=0;}
if(s==0){strip.setPixelColor(11, strip.Color(0, 0, 0));}
else{strip.setPixelColor(s-1, strip.Color(0, 0, 0)); }
if(m==0){strip.setPixelColor(11, strip.Color(0, 0, 0));}
else{strip.setPixelColor(m-1, strip.Color(0, 0, 0)); }
if(h==0){strip.setPixelColor(11, strip.Color(0, 0, 0));}
else{strip.setPixelColor(h-1, strip.Color(0, 0, 0)); }
strip.setPixelColor(s, strip.Color(0, 10, 0));
strip.setPixelColor(m, strip.Color(0, sm, 10));
strip.setPixelColor(h, strip.Color(10, sh, mh));
strip.show();
}