def disp_word(): text = flask.request.args.get('text') print(text) lcd = lcd_driver.lcd() lcd.lcd_clear() async_display(remove_accents(text)[:15]) return 'Hello World!'
#!/usr/bin/python # -*- coding: utf-8 -*- from threading import Thread, Event from time import sleep import PID as PID import os.path import lcd_driver import Adafruit_GPIO.SPI as SPI import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library import MAX6675.MAX6675 as MAX6675 import paho.mqtt.client as mqtt mylcd = lcd_driver.lcd() GPIO.setwarnings(False) # Ignore warning for now GPIO.setmode(GPIO.BOARD) # Use physical pin numbering GPIO.setup(36, GPIO.OUT, initial=GPIO.LOW) GPIO.setup(37, GPIO.IN, pull_up_down=GPIO.PUD_UP) # Rotary decoder settings clk = 33 dt = 35 GPIO.setup(clk, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(dt, GPIO.IN, pull_up_down=GPIO.PUD_UP) counter = 0 clkLastState = GPIO.input(clk) # Thermocouple sensor initializing
#!/usr/bin/python3 import time import re import lcd_driver import keypad import db_driver import rfid_driver import net_driver reader = rfid_driver.rfid_driver() lcd = lcd_driver.lcd() kp = keypad.keypad() db = db_driver.db_driver() ip = net_driver.net_driver().get_ip_address() if ip: lcd.lcd_print_lines("Coffee Billing", "{}".format(ip)) else: lcd.lcd_print_lines("Coffee Billing", "NETWORK ERROR") time.sleep(10) CONTROL_SET = set(['A', 'B', 'C', 'D']) REJECT_I_GOOD = 1 while True: lcd.lcd_print_lines("Choose product:") while True: button = kp.getKey() if button is not None: slot = None
import lcd_driver as lcd from time import * mylcd = lcd.lcd() while True: mylcd.lcd_display_string("Hello ", 1) sleep(1) mylcd.backlight(1)
url = "http://azurarestapi.herokuapp.com/api/auth" payload = "access_token=o2O1JVW8WMy20UtizkzneumvGE1F33ym" headers = { 'content-type': "application/x-www-form-urlencoded", 'authorization': "Basic cml6cXlmYWlzaGFsMjdAZ21haWwuY29tOnBhc3N3b3Jk", 'cache-control': "no-cache", 'postman-token': "f1a80315-d24c-1612-bdd9-bcd1a60d4841" } response = requests.request("POST", url, data=payload, headers=headers) jwt_token = 'Bearer ' + json.loads(response.text)['token'] continue_reading = True my_lcd = lcd.lcd() # Capture SIGINT for cleanup when the script is aborted def end_read(signal,frame): global continue_reading continue_reading = False GPIO.cleanup() # Hook the SIGINT signal.signal(signal.SIGINT, end_read) # Create an object of the class MFRC522 MIFAREReader = MFRC522.MFRC522()