Code Monkey home page Code Monkey logo

smartwatchos's People

Contributors

thebigmisha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

smartwatchos's Issues

ANALOG CLOCK for Micro:bit & Micro:bit V2

VIEW CODE IN OS
@THEBIGMISHA
THIS CODE needed to display Micro:bit analog clock
FOR THE CODE TO WORK YOU NEED:

  • Variable Hours (Hours)
  • Variable Minutes (Minutes)
  • Variable AODDATA (Brightness)
    END
 ​def​ ​Watch​(): 
 ​    ​global​ ​Hours 
 ​    ​global​ ​Minutes 
 ​    ​global​ ​AODDATA 
 ​    ​basic​.​clear_screen​() 
 ​    ​led​.​plot​(​2​, ​2​) 
 ​    ​led​.​set_brightness​(​AODDATA​) 
 ​    ​#Hours 
 ​    ​if​ ​Hours​ ​==​ ​0​: 
 ​        ​led​.​plot​(​2​, ​1​) 
 ​    ​elif​ ​Hours​ ​==​ ​1​ ​or​ ​Hours​ ​==​ ​2​: 
 ​        ​led​.​plot​(​3​, ​1​) 
 ​    ​elif​ ​Hours​ ​==​ ​3​: 
 ​        ​led​.​plot​(​3​, ​2​) 
 ​    ​elif​ ​Hours​ ​==​ ​4​ ​or​ ​Hours​ ​==​ ​5​: 
 ​        ​led​.​plot​(​3​, ​3​) 
 ​    ​elif​ ​Hours​ ​==​ ​6​: 
 ​        ​led​.​plot​(​2​, ​3​) 
 ​    ​elif​ ​Hours​ ​==​ ​7​ ​or​ ​Hours​ ​==​ ​8​: 
 ​        ​led​.​plot​(​1​, ​3​) 
 ​    ​elif​ ​Hours​ ​==​ ​9​: 
 ​        ​led​.​plot​(​1​, ​2​) 
 ​    ​elif​ ​Hours​ ​==​ ​10​ ​or​ ​Hours​ ​==​ ​11​: 
 ​        ​led​.​plot​(​1​, ​1​) 
 ​    ​elif​ ​Hours​ ​==​ ​12​: 
 ​        ​led​.​plot​(​2​, ​1​) 
 ​    ​elif​ ​Hours​ ​==​ ​13​ ​or​ ​Hours​ ​==​ ​14​: 
 ​        ​led​.​plot​(​3​, ​1​) 
 ​    ​elif​ ​Hours​ ​==​ ​15​: 
 ​        ​led​.​plot​(​3​, ​2​) 
 ​    ​elif​ ​Hours​ ​==​ ​16​ ​or​ ​Hours​ ​==​ ​17​: 
 ​        ​led​.​plot​(​3​, ​3​) 
 ​    ​elif​ ​Hours​ ​==​ ​18​: 
 ​        ​led​.​plot​(​2​, ​3​) 
 ​    ​elif​ ​Hours​ ​==​ ​19​ ​or​ ​Hours​ ​==​ ​20​: 
 ​        ​led​.​plot​(​1​, ​3​) 
 ​    ​elif​ ​Hours​ ​==​ ​21​: 
 ​        ​led​.​plot​(​1​, ​2​) 
 ​    ​elif​ ​Hours​ ​==​ ​22​ ​or​ ​Hours​ ​==​ ​23​: 
 ​        ​led​.​plot​(​1​, ​1​) 
 ​    ​elif​ ​Hours​ ​==​ ​24​: 
 ​        ​led​.​plot​(​2​, ​1​) 
 ​    ​#Minutes 
 ​    ​if​ ​Minutes​ ​==​ ​59​ ​or​ ​Minutes​ ​<​ ​3​: 
 ​        ​led​.​plot​(​2​, ​0​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​3​ ​and​ ​Minutes​ ​<​ ​5​: 
 ​        ​led​.​plot​(​3​, ​0​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​5​ ​and​ ​Minutes​ ​<​ ​11​: 
 ​        ​led​.​plot​(​4​, ​0​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​11​ ​and​ ​Minutes​ ​<​ ​14​: 
 ​        ​led​.​plot​(​4​, ​1​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​14​ ​and​ ​Minutes​ ​<​ ​18​: 
 ​        ​led​.​plot​(​4​, ​2​) 
 ​    ​elif​ ​Minutes​ ​>=​18​  ​and​ ​Minutes​ ​<​ ​20​: 
 ​        ​led​.​plot​(​4​, ​3​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​20​ ​and​ ​Minutes​ ​<​ ​26​: 
 ​        ​led​.​plot​(​4​, ​4​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​26​ ​and​ ​Minutes​ ​<​ ​29​: 
 ​        ​led​.​plot​(​3​, ​4​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​29​ ​and​ ​Minutes​ ​<​ ​33​: 
 ​        ​led​.​plot​(​2​, ​4​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​33​ ​and​ ​Minutes​ ​<​ ​35​: 
 ​        ​led​.​plot​(​1​, ​4​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​35​ ​and​ ​Minutes​ ​<​ ​41​: 
 ​        ​led​.​plot​(​0​, ​4​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​41​ ​and​ ​Minutes​ ​<​ ​44​: 
 ​        ​led​.​plot​(​0​, ​3​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​44​ ​and​ ​Minutes​ ​<​ ​47​: 
 ​        ​led​.​plot​(​0​, ​2​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​47​ ​and​ ​Minutes​ ​<​ ​49​: 
 ​        ​led​.​plot​(​0​, ​1​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​49​ ​and​ ​Minutes​ ​<​ ​55​: 
 ​        ​led​.​plot​(​0​, ​0​) 
 ​    ​elif​ ​Minutes​ ​>=​ ​55​ ​and​ ​Minutes​ ​<​ ​59​: 
 ​        ​led​.​plot​(​1​, ​0​)

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.