def draw(self): lcd = LCD() lcd.fillScreen(LCD.color.BLACK) lcd.setTextColor(LCD.color.WHITE, LCD.color.DARKGREY) if IS_VIRTUAL_MACHINE: lcd.keyCallback = self.keyCallback while True: self.drawMenuButton(lcd, KeyMap.WIO_KEY_A, "CHECK", 0) self.drawMenuButton(lcd, KeyMap.WIO_KEY_B, "NEXT", 1) self.drawMenuButton(lcd, KeyMap.WIO_KEY_C, "RESET", 2) lcd.setTextColor(LCD.color.WHITE, LCD.color.BLACK) lcd.setTextSize(2) lcd.drawString("13 * 5 + 8 = ?", 50, 70) lcd.setTextSize(1) lcd.drawLine(int(60), int(0), int(60), int(20), LCD.color.WHITE) lcd.drawLine(int(120), int(0), int(120), int(20), LCD.color.WHITE) lcd.drawLine(int(180), int(0), int(180), int(20), LCD.color.WHITE) lcd.drawLine(int(0), int(20), int(180), int(20), LCD.color.WHITE) time.sleep(self.MAIN_LOOP_DELAY)
from machine import LCD tft = LCD() tft.fillScreen(tft.color.BLACK) tft.drawPixel(50, 50, tft.color.WHITE) tft.drawLine(10, 1, 100, 10, tft.color.WHITE) tft.drawRoundRect(110, 70, 100, 100, 10, tft.color.GREEN) tft.fillRoundRect(220, 100, 10, 20, 2, tft.color.GREEN) tft.drawTriangle(160, 70, 60, 170, 260, 170, tft.color.BLUE) tft.drawNumber(70, 20, 100) tft.drawFloat(3.1415, 300, 400) tft.drawChar(10, 10, 2, 64) tft.setTextColor(tft.color.RED) tft.setTextSize(1) tft.drawString("Hello world!", 230, 210) tft.setTextSize(2) tft.drawString("H", 200, 210) tft.drawCircle(100, 100, 50, tft.color.WHITE)