Example #1
0
def lcd(data):
    if data["command"] == "write":
        lcd.write(data["value"])
        return True
    if data["command"] == "clear":
        lcd.clear()
        return True
    if data["command"] == "set_contrast":
        lcd.set_contrast(data["contrast"])
        return True
    if data["command"] == "set_cursor_position":
        lcd.set_cursor_position(data["column"], data["row"])
        return True
    if data["command"] == "set_cursor_offset":
        lcd.set_cursor_offset(data["offset"])
        return True
    if data["command"] == "set_display_mode":
        lcd.set_display_mode(data["enable"], data["cursor"], data["blink"])
        return True
    if data["command"] == "create_char":
        lcd.create_char(data["char_pos"], data["char_map"])
        return True
    if data["command"] == "create_animation":
        lcd.create_animation(data["anim_pos"], data["anim_map"],
                             data["frame_rate"])
        return True
    if data["command"] == "update_animations":
        lcd.update_animations()
        return True
Example #2
0
def clean_up(signal, frame):
    global clock_on
    print "Stopping clock..."
    clock_on = 0
    lcd.set_display_mode(enable=False)
    lcd.clear()
    backlight.off()
    print "Goodbye!"
Example #3
0
 def reset():
     lcd.clear()
     backlight.off()
     GVars.LED_RED = 0
     GVars.LED_GREEN = 0
     GVars.LED_BLUE = 0
     backlight.set_graph(0)
     lcd.set_display_mode(enable=True,cursor=False,blink=False)
     lcd.set_contrast(45)
Example #4
0
    def setup_logging():
        LOG_FILENAME = 'probeLED.log'

        parser = argparse.ArgumentParser()
        parser.add_argument("--debug",
                            action="store_true",
                            help="Debug Mode Logging")
        args = parser.parse_args()

        if args.debug:
            logging.basicConfig(format="[%(asctime)s] [%(levelname)8s] --- %(message)s (%(filename)s:%(lineno)s)",
                                level=logging.DEBUG)
            logging.debug(sys.path)
            logging.debug(args)
            logging.debug('Debug Mode Enabled')
            lcd.set_display_mode(blink=True)
        else:
            logging.basicConfig(filename=LOG_FILENAME,
                                format="[%(asctime)s] [%(levelname)8s] --- %(message)s (%(filename)s:%(lineno)s)",
                                level=logging.WARNING)
Example #5
0
import time
import wiringpi
from threading import Thread, Event, Lock
from gpiozero import RGBLED, Buzzer

from dothat import lcd
from interface_strings import *

lcd.set_display_mode()
lcd.set_contrast(20)

import locale
locale.setlocale(locale.LC_ALL, display_locale)

backlight = RGBLED(5, 6, 13)

buzzer = Buzzer(22)

message_lock = Lock()

terminal_enabled = 0
terminal_message = ""
terminal_amount = 0

lcd.create_animation(
    7,
    [[0b00000, 0b10001, 0b01010, 0b00100, 0b10001, 0b01010, 0b00100, 0b00000],
     [0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000, 0b00000]],
    1)