Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#define PIN 13
#define BLUE strip.Color(0,0,255)
#define BLACK strip.Color(0,0,0)
#define GREEN strip.Color(0,255,0)
#define RED strip.Color(255,0,0)
#define WHITE strip.Color(255,255,255)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(12, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
// put your setup code here, to run once:
void loop() {
// put your min code here, to run repeatedly:
//strip.setPixelColor(6, BLUE);
for (int i=0; i<24; i++) {
for (int j=0; j<60; j++) {
for (int k=0; k<60; k++){
setClock(i, j, k);
void setClock (int hour, int minute, int sec) {
for(int i=0; i<12; i++){
strip.setPixelColor(i, BLACK);
strip.setPixelColor((sec/5+PIXELOFFSET)%12, RED);
strip.setPixelColor((minute/5+PIXELOFFSET)%12, BLUE);
strip.setPixelColor((hour+PIXELOFFSET)%12, WHITE);;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.