예제 #1
0
def test():
    print('''Main screen populates text box slowly to show
    wrapping in action. "Fast" screen
    shows fast updates using internal font. "Tab"
    screen shows use of tab characters with Python
    font.
    Text boxes may be scrolled by touching them near
    the top or bottom.''')
    setup()
    Screen.change(BaseScreen)
예제 #2
0
def setup():
    pwr = Pin(25, Pin.OUT)
    pwr(1)
    sleep_ms(100)
    # Hardware SPI on native pins for performance. See examples in doc
    # http://docs.micropython.org/en/latest/esp32/quickref.html#hardware-spi-bus
    # Seems to be necessary to explicitly state pin ID's even when using defaults
    spi = SPI(1, 10_000_000, sck=Pin(14), mosi=Pin(13), miso=Pin(12))
    i2c = I2C(0, freq=1_000_000
              )  # As per examples in docs, don't need to specify defaults
    # Alternatives. Note pin 19 conflicts with native I2C(0)
    #spi = SPI(2, 10_000_000, sck=Pin(18), mosi=Pin(23), miso=Pin(19))
    #i2c = I2C(1, scl=Pin(25), sda=Pin(26), freq=1_000_000)
    #i2c = I2C(0, scl=Pin(18), sda=Pin(19), freq=1_000_000)

    lcd = LCD160CR_G(pwr=pwr, spi=spi, i2c=i2c)  # Set connection
    lcd.set_orient(lcd160cr.LANDSCAPE)  # and orientation
    Screen.setup(lcd)
예제 #3
0
 def fwd(button):
     Screen.change(cls_screen)
예제 #4
0
 def rbcb(button, screen, clip):  # RadioButton callback
     Screen.change(screen, args=(clip, ))
예제 #5
0
 def back(self, button, text):
     Aperture.value(text)  # Save value for calling screen
     Screen.back()
예제 #6
0
 def back(self, button, text):
     Aperture.value(text)
     Screen.back()
예제 #7
0
 def back(button):
     Screen.back()
예제 #8
0
 def quit(button):
     Screen.shutdown()
 def _touched(self, x, y):
     if len(self.elements) > 1:
         location = self.location[0], self.location[1] + self.height + 1
         args = (location, self, self.width - self.height)
         Screen.change(_ListDialog, args = args)
 def callback(self, obj_listbox):
     if obj_listbox._initial_value is not None: # a touch has occurred
         val = obj_listbox.textvalue()
         Screen.back()
         if self.dropdown is not None: # Part of a Dropdown
             self.dropdown.value(obj_listbox.value()) # Update it
예제 #11
0
def test():
    print('Test TFT panel...')
    setup()
    Screen.change(StartScreen)
예제 #12
0
 def clear(self):
     tft = Screen.get_tft()
     self.curves = set()
     tft.fill_rectangle(self.x0, self.y0, self.x1, self.y1, self.bgcolor)
     self.show()
예제 #13
0
def setup():
    lcd = LCD160CR_G("Y")  # Set connection
    lcd.set_orient(lcd160cr.LANDSCAPE)  # and orientation
    Screen.setup(lcd)
예제 #14
0
def test():
    print('Test TFT panel...')
    setup()
    Screen.set_grey_style(desaturate=False)  # dim
    Screen.change(SliderScreen)  # Run it!
예제 #15
0
 def rbcb(button, screen):  # RadioButton callback
     Screen.change(screen)
예제 #16
0
def pt():
    print('Testing plot module...')
    setup()
    Screen.change(BaseScreen)
예제 #17
0
def test():
    print('Testing TFT...')
    setup()
    Screen.change(BaseScreen)
예제 #18
0
 def fwd(button, screen):
     Screen.change(screen)
예제 #19
0
def test():
    setup()
    Screen.change(BaseScreen)
예제 #20
0
 def fwd(button):
     Screen.change(BackScreen)
예제 #21
0
 def fwd(button):
     Screen.change(cls_screen, args=args, kwargs=kwargs)