"""This app needs an SDS011 sensor attacthed to UART 4 """ ___name___ = "Air Quality" ___license___ = "MIT" ___dependencies___ = ["sleep", "app", "ugfx_helper", "buttons", "homescreen"] ___categories___ = ["EMF"] ___bootstrapped___ = False # Whether or not apps get downloaded on first install. Defaults to "False", mostly likely you won't have to use this at all. import app import ugfx, os, time, sleep from tilda import Buttons from tilda import Sensors from machine import Pin from machine import UART from machine import Neopix import random class DustSensorTester(object): verbose = False def contains_sequence (self,data, test): """ Checks to see if the data sequence contains the test sewquence Args: data: sequence of data items test: test sequence Returns: True if the test sequence is in the data sequence """ if len(data) 0: sensor_port.readinto(buffer,1) sensor.pump_byte(buffer[0]) sleep.wfi() ugfx.clear() app.restart_to_default()