Giter Club home page Giter Club logo

unicornclock's Introduction

UnicornClock

Unicorn Clock Example

Example video

Features

  • NTP time
  • Brightness adjustement (manually or automatically)
  • Character animation / effect
  • Set the position of the clock
  • Change the background color, the text, each letters
  • You can change the spacing between each letters
  • Create your own font
  • Easily hackable
  • Display a calendar frame

Compatibility

  • Pimoroni Galactic Unicorn
  • Work in progress for the Pimoroni Cosmic Unicorn

Installation

Copy the files into the device via Thonny or the way you want.

Create a secrets.py file:

WLAN_SSID = 'Your WLAN SSID'
WLAN_PASSWORD = 'Your secrets password'

Example

The example.py display the calendar widget and the clock with an effect when number changes.

  • Adjust the brightness with the dedicated buttons
  • Change the clock and calendar positions with A button
  • Change the effect with B button

Use

Here is a detailed example explaining how to use this project.

import uasyncio as asyncio

# This imports is useful to configure the screen
from galactic import GalacticUnicorn
from picographics import DISPLAY_GALACTIC_UNICORN, PicoGraphics

# We want to update the brightness and change the position
from unicornclock import Brightness, Clock, Position

# Import the rainbow move effect
from unicornclock.effects import RainbowMoveEffect

# Load the GalacticUnicorn and PicoGraphics
galactic = GalacticUnicorn()
graphics = PicoGraphics(DISPLAY_GALACTIC_UNICORN)

# Here, we declare a rainbow clock by using the RainbowMoveEffect with Clock
class RainbowMoveEffectClock(RainbowMoveEffect, Clock):
    pass

async def example():
    # Create Brightness object for handling the brightness of the screen
    # depending of the brightness of the piece (screens have light sensors).
    brightness = Brightness(galactic)

    # Creating the Clock
    clock = RainbowMoveEffectClock(
        galactic,
        graphics,
        x=Position.CENTER,
        show_seconds=True,
        am_pm_mode=False,
    )

    # And now, we creating the 2 tasks
    asyncio.create_task(brightness.run())
    asyncio.create_task(clock.run())

loop = asyncio.get_event_loop()
loop.run_until_complete(example())
loop.run_forever()

TODO

Here is what I plan to add and feel free to make suggestions or code submissions.

  • PID controlled brightness for auto mode
  • Save the calendar position / effect and restore it on the boot
  • Ability to drive the screen by an HTTP API
  • Handle sound

Contribute

unicornclock's People

Contributors

hugokernel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

adamdubey

unicornclock's Issues

How to set the timezone

Hi, thanks for this cool clock, I have put this on my Galactic Unicorn but cannot seem to figure out how it pulls the correct time, the clock starts at 02:00:10 when I power it on, I believe this is because of the UTC offset of 2 in the example code. I can see it's connected to my router successfully so was expecting it to pull "some" correct time but it doesn't appear to. Help?

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.