Code Monkey home page Code Monkey logo

avrpowermanager's Introduction

AVRPowerManager

enter image description here

AVRPowerManager is an Arduino Library with the help of which one can shutdown a AVR Microcontroller trough code or special shutdown pattern read from the serial output of a 8 bit shift register, as the one present in the classic Nintendo NES controller. It uses Atmel's official <avr/sleep.h> C++ sleep modes interfaces.

Usage

  1. Get reference to the shared instance from type AVRPowerManager with AVRPowerManager::shared()
  2. Call the AVRPowerManager::shared()->shutdownIfNeeded(int8_t inputFromShiftRegister) in the main aplication loop and optionally pass input from the shift register. The library checks for simultaneous presses of "start" + "select" buttons from NES Controller to trigger shutdown or auto shutdowns in after 2 mins.
  3. Drive pin 2 (INT0) LOW to wake up the microcontroller.
  4. You can alter the behaviour for expected states and start states by changing the config in AVRPowerManager.ccp file.

For more information you can see the example from the library - "AVRPowerManagerNESController" which uses HEF4021BP

Installation

For detailed instructions check the official guides here

Manual Installation

  1. Put the folder AVRPowerManager from the repo inside your "custom library" directory.
    • this directory is different for macOS, Linux and Windows. (checkout the official guides to find out where this directory is)
  2. You should now be able to see the new library AVRPowerManager in the libraries list.

Using the Add Zip Library option of Arduino IDE

  1. Choose the Add Zip Library option from inside Sketch > Include Library > Add Zip Library...
  2. Select the zip file from the repo AVRPowerManager.zip
  3. You should now be able to see the new library AVRPowerManager in the libraries list.
  • in case of issues always double check your connections!

avrpowermanager's People

Contributors

stoqn4opm avatar

Watchers

 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.