This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### BEGIN INIT INFO | |
# Provides: time and temp on 7-segment | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: 7-segment display | |
# Description: time and temp | |
### END INIT INFO | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOG=/var/log/timetemp.log | |
echo tmp102 0x48 > /sys/class/i2c-adapter/i2c-0/new_device | |
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-0/new_device | |
hwclock &> $LOG | |
date &>> $LOG | |
hwclock -s &>> $LOG | |
date &>> $LOG | |
/home/pi/timetemp/timetemp.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# element14 Blog post: | |
# http://www.element14.com/community/groups/raspberry-pi/blog/2012/09/26/time-temp-display-for-raspberry-pi | |
# Based on Simon Monk's library: | |
# http://www.doctormonk.com/2012/08/led-clock-using-raspberry-pi.html | |
# | |
import i2c7segment as display | |
import time | |
import sensors | |
from time import sleep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import Timer | |
def debounce(wait): | |
""" Decorator that will postpone a functions | |
execution until after wait seconds | |
have elapsed since the last time it was invoked. """ | |
def decorator(fn): | |
def debounced(*args, **kwargs): | |
def call_it(): |
NewerOlder