This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
raspi [2014/05/16 09:05] – heikopikner | raspi [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 7: | Line 7: | ||
<code c> | <code c> | ||
5+9 | 5+9 | ||
- | print („Tere Kevad”) | + | print ("Tere Kevad") |
56/ | 56/ | ||
- | print („Tere Kevad”) | + | print ("Tere Kevad") |
3 > 7 | 3 > 7 | ||
for x in range (1,10): | for x in range (1,10): | ||
Line 20: | Line 20: | ||
<code c> | <code c> | ||
+ | # -*- coding: utf-8 -*- | ||
kaal = float(input(" | kaal = float(input(" | ||
if kaal > 100: | if kaal > 100: | ||
Line 58: | Line 58: | ||
import Tkinter as tk | import Tkinter as tk | ||
- | |||
class Application(tk.Frame): | class Application(tk.Frame): | ||
def __init__(self, | def __init__(self, | ||
Line 102: | Line 101: | ||
GPIO.setmode(GPIO.BOARD) | GPIO.setmode(GPIO.BOARD) | ||
GPIO.setup(sensorPin, | GPIO.setup(sensorPin, | ||
- | prevState = False | ||
- | currState = False | ||
while True: | while True: | ||
- | time.sleep(0.1) | + | time.sleep(0.1) |
- | | + | |
- | currState = GPIO.input(sensorPin) | + | |
- | if currState != prevState: | + | |
- | newState = " | + | |
- | print "%s, %s" % (newState) | + | |
</ | </ | ||
Line 117: | Line 110: | ||
- lisatakse reale kuupäev ja kellaaeg, ning tulemus kirjutatakse log-i faili. | - lisatakse reale kuupäev ja kellaaeg, ning tulemus kirjutatakse log-i faili. | ||
- tulemused näidatakse reaalajas graafiliselt (Vihje: Reaalaja graafilise väljundi tekitamiseks | - tulemused näidatakse reaalajas graafiliselt (Vihje: Reaalaja graafilise väljundi tekitamiseks | ||
+ | |||
+ | https:// |