Exemplo n.º 1
0
class HelpPage(tk.Frame):
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)

        label = tk.Label(self, text="help page for all the penises: ")

        button_page = tk.Button(self, text="Home", anchor="sw",
                                command=lambda: controller.show_frame(HomePage))
        button_quit = tk.Button(self, text="quit", anchor="sw", command=self.quit)

        label.grid(row=0, column=0, pady=10, padx=10, sticky="w")

        button_page.grid(row=3, column=1, pady=10, padx=10, sticky="se")
        button_quit.grid(row=4, column=1, pady=10, padx=10, sticky="se")


rpi = Board()
sense = _SenseHat(rpi)

pir = PIR(rpi, 6)  # passing in board object and pin number of the pir
buzz = Buzzer(rpi, 20)
ldr = LDR(rpi, 21)

app = App()

app.mainloop()

# buzzer pin = 20
# pir pin = 6
# ldr pin = 21
Exemplo n.º 2
0
import json
import threading
import sys
import os
import time
import datetime
import requests
from subprocess import check_output

openweathermap_url = "https://api.openweathermap.org/data/2.5/forecast?q=kortrijk,BE&appid=5ab3cf66921da480525dffd751748008&units=metric&lang=nl"

# rotary encoder
rotary_encoder = Rotary()

# PIR sensor
pir = PIR(14)

# temperature sensor: name of the one-wire bus file
sensor_filename = "/sys/bus/w1/devices/28-0317977998cd/w1_slave"

# ledstrip (32 leds)
ledstrip = Ledstrip(16)

current_user = None

# flask
app = Flask(__name__)
# app.config['SECRET_KEY'] = 'S4cr4tK4y'
CORS(app)
endpoint = '/api/v1'