View difference between Paste ID: CN9rkyCk and gw62ZZq6
SHOW: | | - or go back to the newest paste.
1
import time
2
import RPi.GPIO as GPIO
3
GPIO.setmode(GPIO.BCM)
4
5
GPIO.setup(26, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)
6
7
i = 0
8
9
start = time.time()
10-
while True:
10+
11
while time.time() - start < 60:
12-
        aika = time.time()
12+
13-
        print(aika)
13+
14
15
watts = i*3600.0/10.0
16
17-
        str_i = str(i)
17+
print watts, "Watts"
18-
        print('luku ' + str_i)
18+
19
GPIO.cleanup()