Giter Site home page Giter Site logo

hexclock's Introduction

ballclock

An hexagonal ball clock with RGB leds. Inspired by a ping pong led ball clock (http://hackedgadgets.com/2011/02/02/ping-pong-led-clock/ https://github.com/szczys/Ping-Pong-Clock/blob/master/ping-pong-clock.c), this build makes use of ws2812b RGB leds and distrute them in an hexagonal grid.

The chosen layout is an hexagon of 3-ball radius that make a total of 19 balls. Hours are in the outer hexagon, minutes (5, 15 .. 55) in the central hexagon and the central led is reserved for seconds. For multiples of 10, the closest 5 multiples will be lit.

  2:35
   o o o   
  o o o *  
 o o o o o 
  o * o o  
   o o o
  6:00
   o o o   
  o * * o
 o o o o o 
  o o o o  
   o * o

Also, some information int the shape of numbers is expected.


   o o *   
  o * * *
 o o o * o
  o o * o  
   * * *

ws2821b are 5V powered and consume around 60mA when in full brightness (white). Thus, having a total of 19 leds will get a maximum of 1.14A that should be enough for a 5v, 1A USB charger.

Plan generator https://jsfiddle.net/issalig/w3oorhne/ http://codepen.io/issalig/pen/wgxGaw

Matrix example and NTP https://hackaday.io/project/19773-esp8266-based-neopixel-dashboard https://github.com/PaulStoffregen/Time/blob/master/examples/TimeNTP_ESP8266WiFi/TimeNTP_ESP8266WiFi.ino

MISC CODE FOR HSV

local NUM_LEDS = 5; local i = 1; local d = 1; local hue = 0;

local function hueToRgb(hue) if hue >=0 and hue < 60 then return 255, hue * 255 / 60, 0 end; if hue >=60 and hue < 120 then return (120-hue) * 255 / 60, 255, 0 end; if hue >=120 and hue < 180 then return 0, 255, (hue-120) * 255 / 60 end; if hue >=180 and hue < 240 then return 0, (240-hue) * 255 / 60, 255 end; if hue >=240 and hue < 300 then return (hue-240) * 255 / 60, 0, 255 end; if hue >=300 and hue < 360 then return 255,0,(360-hue) * 255 / 60 end; end

ws2812.init() local buffer = ws2812.newBuffer(NUM_LEDS,3); buffer:fill(0,0,0);

tmr.alarm(0, 50, 1, function() hue = (hue + 1) % 360; local r,g,b = hueToRgb(hue);

i = i + d;
if( i == NUM_LEDS ) then d = -1 end
if( i == 1 ) then d = 1 end
buffer:fade(3);
buffer:set(i, r,g,b);
buffer:write();

end)

hexclock's People

Contributors

issalig avatar iti-praia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.