def load_application(selected): if app.current != None: # clear last application del app.current app.current = None if selected == 0: pass elif selected == 1: app.current = pages() elif selected == 2: pass #app.layer -= 1 # return last layer #raise Exception("Settings Unrealized.") elif selected == 3: sample_page.add_sample(sample_shtxx()) sample_page.add_demo()
def load_application(selected): if app.current != None: # clear last application del app.current app.current = None if selected == 0: pass elif selected == 1: app.current = pages() elif selected == 2: pass #app.layer -= 1 # return last layer #raise Exception("Settings Unrealized.") elif selected == 3: CubeAudio.load(os.getcwd() + "/res/sound/one.wav", 100) sample_page.add_sample(sample_msa301()) sample_page.add_sample(sample_spmod_test()) sample_page.add_sample(sample_shtxx()) sample_page.add_demo()
import machine machine.reset() protect.keep() import time, gc # gc.collect() # gc.collect() if len(sample_page.samples) > 0: sample_page.samples = [] # gc.collect() button_io.config(10, 11, 16) sample_page.key_init() sample_page.add_sample(Report()) # keep sample_page.add_sample(AudioReport()) sample_page.add_sample(AudioTest()) sample_page.add_sample(RearSensorReport()) sample_page.add_sample(RearSensorTest()) sample_page.add_sample(KeyReport()) sample_page.add_sample(KeyTest()) sample_page.add_sample(WaitTestStart()) #sample_page.add_sample(SpmodReport()) sample_page.add_sample(SpmodTest())
ui.canvas.draw_line(30, 140, int((x / 5) + 20), 140, color=(41, 131, 255)) ui.canvas.draw_string(10, 150, "y", (255, 127, 0), scale=2) ui.canvas.draw_line(30, 160, int((y / 5) + 20), 160, color=(141, 31, 255)) ui.canvas.draw_string(10, 170, "z", (255, 127, 0), scale=2) ui.canvas.draw_line(30, 180, int((z / 5) + 20), 180, color=(241, 131, 55)) if __name__ == "__main__": sample_page.add_sample(sample_spmod_test()) @ui.warp_template(ui.blank_draw) @ui.warp_template(sample_page.sample_draw) def unit_test(): ui.display() import time while True: unit_test()
ui.canvas.draw_line(120, 190, 120 + int(self.acceleration[2] * 8), 190, color=(241, 131, 55)) ui.canvas.draw_string(40, 210, str(("%-02.2f %-02.2f %-02.2f" % self.acceleration)), (127, 255, 255), scale=2) if __name__ == "__main__": from ui_taskbar import taskbar sample_page.add_sample(sample_msa301()) @ui.warp_template(ui.blank_draw) @ui.warp_template(taskbar.battery_draw) @ui.warp_template(sample_page.sample_draw) def unit_test(): ui.display() import time while True: unit_test() try: unit_test() except Exception as e: print(e)