def __init__(self): Adafruit_CharLCDPlate.__init__(self) # setup the LCD: self.clear() self.backlight(self.WHITE) self.speed = 0.35 p = op.OptionParser() p.add_option('--sentence', '-s', default=None) options, arguments = p.parse_args() msg_tmp = options.sentence.decode('utf8').strip() msg = ''.join([x for x in msg_tmp if ord(x) < 128]) pad = " " n_tot = 2 * len(pad) + len(msg) top = pad + pad + msg bot = "" # Set some lines to display: lines = [top, bot] # Create our scroller instance: scroller = Scroller(lines=lines) # Display the first unscrolled message: message = "\n".join(lines) self.clear() #self.message(message) sleep(self.speed) i = 0 while i < n_tot: i = i + 1 # Get the updated scrolled lines, and display: message = scroller.scroll() self.message(message) sleep(self.speed) self.clear()
def __init__(self): Adafruit_CharLCDPlate.__init__(self) # setup the LCD: self.clear() self.backlight(self.WHITE) self.speed = 0.35 p = op.OptionParser() p.add_option('--sentence','-s',default=None) options,arguments = p.parse_args() msg_tmp = options.sentence.decode('utf8').strip() msg = ''.join([x for x in msg_tmp if ord(x) < 128]) pad = " " n_tot = 2*len(pad)+len(msg) top = pad + pad + msg bot = "" # Set some lines to display: lines=[top,bot] # Create our scroller instance: scroller = Scroller(lines=lines) # Display the first unscrolled message: message = "\n".join(lines) self.clear() #self.message(message) sleep(self.speed) i = 0 while i < n_tot: i = i+1 # Get the updated scrolled lines, and display: message = scroller.scroll() self.message(message) sleep(self.speed) self.clear()
def __init__(self, twitter): Adafruit_CharLCDPlate.__init__(self) threading.Thread.__init__(self) self.twitter = twitter self.query = None self.col = (lcd.RED, lcd.YELLOW, lcd.GREEN, lcd.TEAL, lcd.BLUE, lcd.VIOLET, lcd.ON) self.paused = False
def __init__(self): self.LCDAttached = self.checkPanel() # Initialize the LCD using the pins # see https://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pi/usage if (self.LCDAttached == True): Adafruit_CharLCDPlate.__init__(self) self.camera = GPhoto(subprocess) self.idy = Identify(subprocess) self.netinfo = NetworkInfo(subprocess) self.shot = 0 self.displaySet = False
def __init__(self, bm=()): Adafruit_CharLCDPlate.__init__(self) self.backlight(self.OFF) if not bm or type(bm) != list: bm = [] bm += [''] * (4 - len(bm)) self.buttons = dict( left= dict(button=self.LEFT, bg=self.YELLOW, msg=bm[0]), up= dict(button=self.UP, bg=self.ON, msg=bm[1]), down= dict(button=self.DOWN, bg=self.TEAL, msg=bm[2]), right=dict(button=self.RIGHT, bg=self.VIOLET, msg=bm[3]) )
def __init__(self): Adafruit_CharLCDPlate.__init__(self) self.backlight(self.GREEN) self.lastTime = time.time() self.timeout = 0 self.DEFAULTIMEOUT = 5 self.lastButton = self.LEFT self.lastBounce = 0 self.DEBOUNCETIME = 0.4 self.FASTDEBOUNCETIME = 0.2 self.timeDebounce = self.DEBOUNCETIME self.CANCEL = self.RIGHT self.screenContent = self.LOADINGMSG self.menuEntries = [] self.currentEntry = 0 self.roll = False self.currentShift = 0 self.shiftTimeout = 0.8 self.lastShiftTime = time.time()
def __init__(self): Adafruit_CharLCDPlate.__init__(self) self.previous_button = None
def __init__(self): self.last_message = None Adafruit_CharLCDPlate.__init__(self)