promml / narcoleptic Goto Github PK
View Code? Open in Web Editor NEWThis project forked from brabl2/narcoleptic
Sleep library for Arduino (compatible with arduino-tiny core)
This project forked from brabl2/narcoleptic
Sleep library for Arduino (compatible with arduino-tiny core)
Narcoleptic uses some features of the microcontroller to reduce power consumption. These are: Sleep mode: Freezes all microcontroller functions to dramatically reduce power. 128kHz internal oscillator: This is a very low power oscillator, used to inform the microcontroller when to wake up. Power reduction: Unused microcontroller functions can be powered down to save additional power. Power saving tips: Narcoleptic only reduces the current used by the microcontroller. It does not reduce the current of anything connected to it. A power-on LED can use 20mA. A voltage regulator can use 15mA. The FTDI USB to serial chip uses about 15mA, so Arduino Duemilanoves and Diecimilas are not suitable for low power use without modification. Running at 3.3V and 8MHz uses much less energy than 5V at 16MHz. Pull-up and pull-down resistors use energy if they are passing current. Prefer normally-open switches over normally-closed. Consider using software pullups, and only turning them on when you need them. The Atmel ATmega328P data sheet has a section on "Minimising Power Consumption". Narcoleptic tricks: The 128kHz oscillator is not very accurate. It drifts by ±4.5% over the full voltage and temperature ranges. Narcoleptic measures its speed against the main clock, and bases all its timings on the corrected value. Provided the operating voltage and temperature remain stable, Narcoleptic should maintain < ±1% accuracy. The 128kHz oscillator only provides sleep periods of 8,4,2,1 seconds, 500, 250, 125, 62, 31 and 15ms. Narcoleptic performs multiple sleeps to achieve the requested timing. Keeping track of time: Narcoleptic shuts down almost everything - even the millis() counting routine. To get around this, Narcoleptic keeps track of the time in sleep mode. If you replace: millis() with: (millis() + Narcoleptic.millis()) your timing calculations will take into account the time in sleep mode. Narcoleptic gotchas: When doing a Narcoleptic.delay(), the following systems are frozen: Serial communication PWM outputs millis() ticker All timer activity Narcoleptic is best used when nothing is going on anyway, to simulate a power-off state. In a well optimised circuit, Narcoleptic can run for several years off a couple of AAA batteries.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.