lcd.clear() elif command == 'setContrast': lcd.set_contrast(parameters['contrast']) elif command == 'setCursorPosition': lcd.set_cursor_position(parameters['column'], parameters['row']) elif command == 'write': lcd.write(parameters['value']) elif command == 'createCharacter': lcd.create_char(parameters['memoryPosition'], parameters['map']) elif command == 'writeCharacter': lcd.write(chr(parameters['memoryPosition'])) elif component == 'Backlight': if command == 'turnOff': backlight.off() elif command == 'useRBGMode': backlight.use_rbg() elif command == 'setBrightnessOfLed': backlight.set(parameters['ledIndex'], parameters['brightness']) elif command == 'setToHue': backlight.hue(parameters['hue']) elif command == 'setLeftToHue': backlight.left_hue(parameters['hue']) elif command == 'setMiddleToHue': backlight.mid_hue(parameters['hue']) elif command == 'setRightToHue': backlight.right_hue(parameters['hue']) elif command == 'setToRGB': backlight.rgb(parameters['red'], parameters['green'], parameters['blue']) elif command == 'setLeftToRGB': backlight.left_rgb(parameters['red'], parameters['green'], parameters['blue']) elif command == 'setMiddleToRGB':
import settings as sett import dot3k.lcd as lcd import dot3k.backlight as backlight from os.path import isfile, join from datetime import datetime from settings import rgb_rbg, timeformat, gpio_bell, logging, debug, txt_security,\ txt_pressme, txt_ring, txt_ring2, txt_wait1, txt_wait2, txt_wait3, txt_coming,\ txt_away1, txt_away2, txt_away3, txt_package1, txt_package2, txt_package3,\ push_enabled, push_app_key, push_user_key, pictures_enabled, snap_url, outputpath # Set GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(gpio_bell, GPIO.IN , pull_up_down=GPIO.PUD_DOWN) if rgb_rbg: backlight.use_rbg() if logging == "txt": logfile = sett.logfile elif logging == "db": conn = sqlite3.connect(sett.database) c = conn.cursor() else: sys.exit("[Error] Please choose a proper logging format.") ############# # FUNCTIONS # ############# def ts(): return datetime.now().strftime(timeformat)
def __init__(self, rail, config=None): lcd.clear() bl.off() Displayotron.rail = rail self.config = config if config['use_rbg']: bl.use_rbg()
#!/usr/bin/env python import dot3k.lcd as lcd import dot3k.backlight as backlight backlight.use_rbg() backlight.off() lcd.clear()
#!/usr/bin/env python # -*- coding: utf-8 -*- # This script will get the current weather forecast from # # Dark Sky and display a variety of stats on Pimoroni's # # Display-o-Tron 3000, including temperature, humidity, # # chance of rain and the UV index. The backlight colour will # # change depending on the UV index and the bar graph will # # increase as the chance of rain does. You can also exit the # # script by pressing the joystick button too! # # Created by Wesley Archer (@raspberrycoulis) # from dot3k import joystick as nav from dot3k import lcd from dot3k import backlight as backlight backlight.use_rbg( ) # Required for early-batch DOT3K's as the RGB LEDs are RBG. from time import sleep import os from ConfigParser import ConfigParser # Import details from config file to save typing config = ConfigParser() config.read('config/config.ini') api_key = config.get('darksky', 'key') latitude = config.get('darksky', 'latitude') longitude = config.get('darksky', 'longitude') units = config.get('darksky', 'units') try: import darksky except ImportError: