From ac0e46dda708adf9addaeb48e8e753668cb926fa Mon Sep 17 00:00:00 2001 From: James Bowman Date: Sun, 24 Feb 2019 13:23:31 -0800 Subject: [PATCH] Add proper comment to egg timer --- python/samples/EDS-egg-timer.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/python/samples/EDS-egg-timer.py b/python/samples/EDS-egg-timer.py index e6db9dc..d096f80 100644 --- a/python/samples/EDS-egg-timer.py +++ b/python/samples/EDS-egg-timer.py @@ -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: