Giter Site home page Giter Site logo

alarm-clock-using-fsm's Introduction

The initial task involves creating a 24-hour clock with a remarkable 1-millisecond resolution. To achieve this, we can expand the capabilities of the existing scheduler by leveraging its 1-millisecond timer callback. This expansion entails introducing a private time-keeping variable, denoted as "systemTime_t," to accurately store and update the current time at 1-millisecond intervals. When the microcontroller powers up, the clock lacks an initial time reference. Consequently, users must manually set the time via button interactions.

During the uninitialized state, the display showcases a clock in HH:MM format, with an additional line guiding users to set the time. The hour setting is accomplished by repeatedly pressing the Rotary Button, and once completed, the Joystick Button is pressed to move on to configuring the minutes using the Rotary Button. A second press of the Joystick Button finalizes the time setting and initiates clock operation. During normal operation, the time is presented in HH:MM:SS format.

In normal operation mode, users can employ the Rotary Button to toggle the alarm state, and the display is indicative of this status. If the Joystick Button is pressed, the alarm time can be set, and the display line shifts to showing the alarm time in HH:MM format. When the alarm is enabled and the system time aligns with the set alarm time, the red LED blinks at a 4 Hz frequency. The alarm ceases upon any button press or after a 5-second period elapses.

Crucially, the alarm should only trigger when the clock is in its regular operational mode, meaning it must not be activated while configuring the alarm time. Furthermore, the LEDs serve various functionalities: the green LED blinks in sync with the seconds counter, the yellow LED indicates alarm activation, and the red LED flashes at 4 Hz during alarm activation and remains off otherwise.

alarm-clock-using-fsm's People

Contributors

ahmedhusseinelsayed19 avatar

Watchers

James Cloos avatar  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.