def __init__(self) -> None: collect() #clean up memory self.__b = bytearray(115200) #init buffer exp.init(self.__b) #init explorer exp.set_audio_pin(0) #set audio pin self.__palette = b'`\x06`\xce\x00\xc8\x19\x00\xe0\x07\xe0\xff\x00\xf8\x1f\x00@\x04@\x8c\x00\x88\x11\x00\x11\x88\x1f\xf8' self.__fart = 200 #loser/wrong sound self.__startscreen() #init start screen
import time import picoexplorer as explorer width = explorer.get_width() height = explorer.get_height() display_buffer = bytearray(width * height * 2) # 2-bytes per pixel (RGB565) explorer.init(display_buffer) explorer.set_audio_pin(0) i = 1 while True: explorer.set_pen(120, 40, 60) explorer.clear() adc0 = int(explorer.get_adc(0) * 120) adc1 = int(explorer.get_adc(1) * 120) adc2 = int(explorer.get_adc(2) * 120) explorer.set_pen(255, 255, 255) explorer.text("ADC0:", 20, 20, 100) explorer.text("ADC1:", 20, 40, 100) explorer.text("ADC2:", 20, 60, 100) explorer.set_pen(adc0 * 2, 0, 0) explorer.circle(90 + adc0, 26, 10) explorer.set_pen(0, adc1 * 2, 0)
import time, random import picoexplorer as exp from machine import Pin width = exp.get_width() height = exp.get_height() display_buffer = bytearray(width * height * 2) # 2-bytes per pixel (RGB565) exp.init(display_buffer) #exp.set_backlight(1.0) exp.set_audio_pin(0) green = exp.create_pen(0, 155, 0) red = exp.create_pen(155, 0, 0) blue = exp.create_pen(0, 0, 155) yellow = exp.create_pen(155, 155, 0) lit_green = exp.create_pen(0, 255, 0) lit_red = exp.create_pen(255, 0, 0) lit_blue = exp.create_pen(0, 0, 255) lit_yellow = exp.create_pen(255, 255, 0) white = exp.create_pen(200, 200, 200) black = 0 buttons = ["A", "B", "Y", "X"] half_width = width // 2 half_height = height // 2 leda = Pin(4, Pin.OUT) ledy = Pin(3, Pin.OUT) ledx = Pin(2, Pin.OUT) ledb = Pin(5, Pin.OUT)