예제 #1
1
 def __init__(self, rail, config=None):
     lcd.clear()
     bl.off()
     Displayotron.rail = rail
     self.config = config
     if config['use_rbg']:
         bl.use_rbg()
예제 #2
0
def signal_handler(signal, frame):
    global is_active
    is_active = False
    backlight.set_graph(0)
    lcd.clear()
    backlight.off()
    exit(0)
예제 #3
0
파일: dtron.py 프로젝트: pha5matis/pimoroni
def handle_button(pin):
    global ButtonStatus
    global loopcount
    if ButtonStatus == 'On':
        backlight.off()
        ButtonStatus = 'Off'
    else:
        loopcount = 0
        backlight.rgb(229, 0, 255)
        ButtonStatus = 'On'
예제 #4
0
파일: doorPy.py 프로젝트: Pysint/DoorPy
def idle():
    #if debug: print "Start idle function." 
    backlight.off()
    lcd.set_cursor_position(0,0)
    lcd.write(txt_security)
    lcd.set_cursor_position(4,1)
    t = datetime.now().strftime("%H:%M:%S")
    lcd.write(t)
    lcd.set_cursor_position(0,2)
    lcd.write(txt_pressme)
    time.sleep(0.5)
예제 #5
0
#!/usr/bin/env python

import dot3k.lcd as lcd
import dot3k.backlight as backlight

backlight.use_rbg()
backlight.off()
lcd.clear()
예제 #6
0
파일: status.py 프로젝트: benc-uk/pikube
def screenOff():
  global screen_on
  backlight.off()
  lcd.clear()
  screen_on = False
예제 #7
0
파일: status.py 프로젝트: benc-uk/pikube
def cleanUp(sig, frame):
  backlight.off()
  lcd.clear()
  print("Exiting kubernetes status server")
  sys.exit(0)
@joystick.on(joystick.BUTTON)
def handle_up(pin):
    emit_event('Joystick', 'button')

while True:
    data = json.loads(raw_input())
    
    component = data['component']
    command = data['command']
    parameters = data['parameters']
    
    if component == 'DisplayOTron':
        if command == 'kill':
            if parameters['performReset']:
                lcd.clear()
                backlight.off()
                backlight.set_graph(0.0)
            
            sys.exit()
        elif command == 'reset':
            lcd.clear()
            backlight.off()
            backlight.set_graph(0.0)
    elif component == 'LCD':
        if command == 'clear':
            lcd.clear()
        elif command == 'setContrast':
            lcd.set_contrast(parameters['contrast'])
        elif command == 'setCursorPosition':
            lcd.set_cursor_position(parameters['column'], parameters['row'])
        elif command == 'write':
예제 #9
0
 def end(self):
     self.printIt(""," fin .","")
     backlight.off()
def signal_handler(signal, frame):
    lcd.clear()
    backlight.off()
    sys.exit(0)
def signal_handler(signal, frame):
        lcd.clear()
        backlight.off()
        sys.exit(0)
예제 #12
0
    def on_event(self, event, payload):

        if event in "Connected":
            lcd.clear()
            lcd.write('Connected to:')
            lcd.set_cursor_position(0, 1)
            lcd.write(payload["port"])

        if event in "Shutdown":
            lcd.clear()
            lcd.write('Bye bye ^_^')
            time.sleep(1)
            backlight.off()
            backlight.update()
            lcd.exit()

        if event in "PrinterStateChanged":

            if payload["state_string"] in "Offline":
                lcd.clear()
                lcd.write('Octoprint is not connected')
                time.sleep(2)
                lcd.clear()
                lcd.write('saving a polar bear, eco mode ON')
                time.sleep(5)
                backlight.off()
                backlight.update()

            if payload["state_string"] in "Operational":
                backlight.rgb(255, 255, 255)
                backlight.update()
                lcd.clear()
                lcd.write('Printer is       Operational')

            if payload["state_string"] in "Cancelling":
                backlight.rgb(255, 0, 255)
                backlight.update()
                lcd.clear()
                lcd.write('Printer  is Cancelling job')
                time.sleep(0.2)

            if payload["state_string"] in "PrintCancelled":
                lcd.clear()
                backlight.rgb(255, 0, 0)
                backlight.update()
                time.sleep(0.5)
                lcd.write(' Job has been Cancelled (0_0) ')
                time.sleep(2)

            if payload["state_string"] in "Paused":
                backlight.rgb(255, 0, 255)
                backlight.update()
                lcd.clear()
                time.sleep(0.5)
                lcd.write('Printer is  Paused')

            if payload["state_string"] in "Resuming":
                backlight.rgb(0, 255, 255)
                backlight.update()
                lcd.clear()
                lcd.write('Printer is Resuming its job')
                time.sleep(0.2)
예제 #13
0
	def power_off(self):
		backlight.off()