Add proper comment to egg timer

This commit is contained in:
James Bowman 2019-02-24 13:23:31 -08:00
parent 0da77dfa56
commit ac0e46dda7
1 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,19 @@
"""
Demo of a simple combination of parts from Electric Dollar Store:
* POT - potentiometer
* DIG2 - 2-digit display
* BEEP - piezo beeper
This demo simulates a kitchen egg-timer.
Twisting the POT sets a countdown time in seconds,
and after it's released the ticker starts counting.
When it reaches "00" it flashes and beeps.
https://electricdollarstore.com
"""
import sys
import struct
import time
from i2cdriver import I2CDriver, EDS
@ -31,7 +45,6 @@ def eggtimer(i2c):
digits.brightness(255)
t = v
digits.dec(t)
digits.dp(0, ticking)
if millis() > next and (t != 0):
ticking = True
if ticking and millis() > next: