Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GNU nano 2.2.6 File: thetiedosto.py Modified
- #!/usr/bin/python
- import picamera
- from time import sleep
- import time
- import smbus
- import sys
- tavoitelampo = 80
- def lampotila():
- temperature = 0
- REG_TEMP = 0b00
- I2C_ADDRESS = 0x48
- bus = smbus.SMBus(1)
- temperature = bus.read_byte_data(I2C_ADDRESS, REG_TEMP)
- return temperature
- print lampotila()
- def arvioi():
- nykyinenLampo = lampotila()
- #if nykyinenLampo >= tavoitelampo:
- # print "Joo 80 astet"
- #else:
- # print "Ei viel oo 80"
- #arvioi()
- def stopwatch(seconds):
- start = time.time()
- time.clock()
- elapsed = 0
- while elapsed < seconds:
- elapsed = time.time() - start
- print "%02d" % (elapsed)
- #print "loop cycle time: %f, seconds count: %02d" % (time.clock() , elapsed)
- time.sleep(60)
- #6h laskuaikaa
- stopwatch(21600)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement