Esempio n. 1
0
    def __init__(self, config, core):
        super(oledScreen, self).__init__()
        self.menu = False
        self.core = core
        self.config = config

        if config['oledScreen']['bus'] and config['oledScreen']['address']:
            self.serial = i2c(bus=SMBus(config['oledScreen']['bus']),
                              address=config['oledScreen']['address'])
        else:
            self.serial = i2c(bus=SMBus(2), address=0x3c)
        self.driver = config['oledScreen']['driver']
        if self.driver == 'ssd1306':
            self.device = ssd1306(self.serial)
        elif self.driver == 'ssd1322':
            self.device = ssd1322(self.serial)
        elif self.driver == 'ssd1325':
            self.device = ssd1325(self.serial)
        elif self.driver == 'ssd1331':
            self.device = ssd1331(self.serial)
        elif self.driver == 'sh1106':
            self.device = sh1106(self.serial)
        else:
            self.device = ssd1306(self.serial)

        self.font = self.make_font('Vera.ttf', 26)
        self.fontSmall = self.make_font('Vera.ttf', 15)
        self.set_image('radio.gif')
Esempio n. 2
0
 def __init__(self):
     # Obtain the full sysfs path of the IIO devices.
     self._hdc2010 = Pi_HDC2080.Pi_HDC2080()
     self._bmp280 = BMP280(port=1,
                           mode=BMP280.FORCED_MODE,
                           oversampling_p=BMP280.OVERSAMPLING_P_x16,
                           oversampling_t=BMP280.OVERSAMPLING_T_x1,
                           filter=BMP280.IIR_FILTER_OFF,
                           standby=BMP280.T_STANDBY_1000)
     #self._opt3002 = _get_path('opt3001')
     self._tla2021 = _get_path('ads1015')
     # Create SSD1306 OLED instance, with SPI as the interface.
     plat = platform.platform()
     if 'mendel' in plat:
         from .rpi_gpio_periphery import pGPIO
         # Values for the Coral Dev Board (running Mendel Linux).
         # If running legacy kernel (4.9.51), use port 32766.
         port = 32766 if 'Linux-4.9.51-imx' in plat else 0
         self._display = ssd1306(serial_interface=spi(gpio=pGPIO(),
                                                      port=port,
                                                      device=0,
                                                      gpio_DC=138,
                                                      gpio_RST=140),
                                 gpio=pGPIO(),
                                 height=32,
                                 rotate=2)
     else:
         # Default to RPi.GPIO in luma and defaults GPIO.
         self._display = ssd1306(serial_interface=spi(cs_high=True),
                                 gpio=noop(),
                                 height=32,
                                 rotate=2)
Esempio n. 3
0
def initOLEDScreen():
    global oleddisp
    global oledfont
    global oledimage
    global oleddraw

    if oleddisp == None:
        from luma.core.interface.serial import i2c
        from luma.core.render import canvas
        from luma.oled.device import ssd1306
        from PIL import Image, ImageDraw, ImageFont

        RESET = 21
        GPIO.setup(RESET, GPIO.OUT)
        GPIO.output(RESET, 0)
        time.sleep(0.01)
        GPIO.output(RESET, 1)

        serial = i2c(port=1, address=0x3C)
        oleddisp = ssd1306(serial, width=oledwidth, height=oledheight)
        oleddisp.cleanup = lambda _: True

        oledfont = ImageFont.load_default()
        #        oledfont = ImageFont.truetype(font="tiny.ttf", size=8)
        oledimage = Image.new('1', (oledwidth, oledheight))
        oleddraw = ImageDraw.Draw(oledimage)

        oleddisp.display(oledimage)
Esempio n. 4
0
def init_display():
    logging.info('initializing displays for the script')
    port_index = 0
    global serial_array
    global display_array
    try:
        for row in range(3):
            for column in range(3):
                logging.info(
                    'initializing display no : {}x{}'.format(row+1, column+1))
                serial_array[row][column] = i2c(
                    port=i2c_port[port_index], address=0x3C)
                logging.debug(
                    '{}x{} no port is initialized'.format(row+1, column+1))
                display_array[row][column] = ssd1306(serial_array[row][column])
                logging.debug(
                    '{}x{} no display is initialized'.format(row+1, column+1))
                port_index = port_index+1
                pass
            pass
    except Exception as client_error:
        logging.error('display initializing failed : {}'.format(client_error))
        pass

    port_index = 0
    pass
Esempio n. 5
0
    def _DisplayText(self,
                     font_path,
                     text1,
                     text2=None,
                     text3=None,
                     text4=None,
                     size=12):
        '''
		显示多行文本
		最少显示一行,最多显示四行
		非特殊情况,请勿修改字体大小
		'''
        self.next.clear()
        serial = i2c(port=1, address=0x3c)
        device = ssd1306(serial)  #挂载设备
        Text_font = ImageFont.truetype(font_path, size)  #设置文本字体
        while not self.next.is_set():
            with canvas(device) as draw:
                draw.text((0, 0), text1, font=Text_font, fill="white")
                if text2 != None:
                    draw.text((0, 14), text2, font=Text_font, fill="white")
                    if text3 != None:
                        draw.text((0, 26), text3, font=Text_font, fill="white")
                        if text4 != None:
                            draw.text((0, 38),
                                      text4,
                                      font=Text_font,
                                      fill="white")
Esempio n. 6
0
    def _initialize_hardware(self):
        """
        Initializes the widget hardware.
        """
        # Import
        try:
            from luma.core.interface.serial import i2c
            from luma.core.render import canvas
            from luma.oled.device import ssd1306
        except Exception as ex:
            logging.error('\n   *** ERROR importing Luma: {}'.format(ex))

            # Things failed, must be running locally, not on a widget, so don't
            # bother initializing I2C
            return

        # Now initialize I2C
        try:
            serial = i2c(port=1, address=0x3C)
            self._device = ssd1306(serial)
        except Exception as ex:
            logging.error(
                '\n   *** ERROR initializing I2C/SSD1306: {}'.format(ex, ), )

            return

        self._canvas = canvas(self._device)

        self._initialize_id_led()
Esempio n. 7
0
	def __init__(self, rows=64, cols=128, i2c_address=0x3d, i2c_port=1, devicetype='ssd1306'):

		self.i2c_address = i2c_address
		self.i2c_port = i2c_port

		self.rows = rows
		self.cols = cols

		self.fb = [[]]

		# Initialize the default font
		font = fonts.bmfont.bmfont('latin1_5x8_fixed.fnt')
		self.fp = font.fontpkg

		serial = i2c(port=i2c_port, address=i2c_address)

		if devicetype.lower() == 'ssd1306':
			self.device = ssd1306(serial)
		elif devicetype.lower() == 'sh1106':
			self.device = sh1106(serial)
		elif devicetype.lower() == 'ssd1322':
			self.device = ssd1322(serial)
		elif devicetype.lower() == 'ssd1325':
			self.device = ssd1325(serial)
		elif devicetype.lower() == 'ssd1331':
			self.device = ssd1331(serial)
		else:
			raise ValueError('{0} not a recognized luma device type'.format(devicetype))
Esempio n. 8
0
def find_devices():
    boxnum = 1
    dev = 0
    dev1 = 0
    for i in busses:
        try:
            calibration_params = bme280.load_calibration_params(i[0], 0x76)
            data = bme280.sample(i[0], 0x76, calibration_params)
            dev = 1
        except:
            dev = 0
        try:
            device = ssd1306(i[1], rotate=0)
            dev1 = 1
        except:
            dev1 = 0
        if dev == 1:
            b = 'box' + str(boxnum)
            BME280[b] = i[0]
            BMEAVG[b] = [0, 0, 0]
        if dev1 == 1:
            b = 'box' + str(boxnum)
            Displays[b] = device
            DisplayInfo[b] = 'stats'

        boxnum = boxnum + 1
Esempio n. 9
0
 def __init__(self):
     self.serial = i2c(port=1, address=0x3C)
     self.device = ssd1306(self.serial)
     self.DisplaySplash()
     time.sleep(
         3
     )  # Keep the splash up for three seconds on boot-up - you can certainly disable this if you want
Esempio n. 10
0
    def __init__(self, settings):
        self.modem_thread = ModemControlThread(settings['Modem'],
                                               self.changes_queue,
                                               self.ws_cmd_queue,
                                               self.ws_res_queue)
        self.modem_thread.create_serial()
        self.modem_thread.setName("MC")

        self.websock_thread = None

        self.url = "http://" + settings['Server']['url']
        self.ws_url = "ws://" + settings['Server']['url']
        self.imsi = "imsi1"
        create_db(settings['Db'])
        self.dbo = DbOperations(settings['Db'])
        self.rest_fail_time = 0
        self.rest_success_time = 0
        self.rest_last_action_success = False

        if int(settings['Main']['oled']) == 1:
            self.oled = ssd1306(i2c(port=1, address=0x3C))
            self.oled_status = 0
            self.status_time = 0
            self.use_oled = True

            # self.draw = canvas(self.oled)
            with canvas(self.oled) as draw:
                draw.text((10, 10), "PySimMonitor", fill="white")
                draw.text((10, 20), "Starting...", fill="white")

        self.essid = ""
        self.operator = ""
        self.csq = 0

        self.modem_status_string = "-"
Esempio n. 11
0
def main():
    serial = i2c(port=1, address=0x3C)
    device = ssd1306(serial)
    device.cleanup = do_nothing

    DHT_SENSOR = Adafruit_DHT.DHT22
    DHT_PIN = 22

    #font = ImageFont.load_default()
    custom_font = ImageFont.truetype("VCR_OSD_MONO.ttf", 21)

    while True:
        humidity, temperature = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)

        with canvas(device) as draw:
            draw.rectangle(device.bounding_box, outline="white", fill="black")

            if humidity is not None and temperature is not None:
                str_temp = ' {0:0.2f} *C'.format(temperature)
                str_hum = ' {0:0.2f} %'.format(humidity)
                string = "Temp={0:0.1f}*C  Humidity={1:0.1f}%".format(
                    temperature, humidity)
                print(string)
                draw.text((4, 10), str_temp, font=custom_font, fill=255)
                draw.text((4, 31), str_hum, font=custom_font, fill=255)
            else:
                print("Failed to retrieve data from humidity sensor")

            sleep(10)
Esempio n. 12
0
 def init_display(self, **kwargs):
     """Initializes SSD1306 controller. """
     self.rotate = kwargs.pop("rotate", self.default_rotate)
     self.device = ssd1306(self.serial,
                           width=self.width,
                           height=self.height,
                           rotate=self.rotate)
Esempio n. 13
0
	def __init__(self, rows=64, cols=128, spi_device=0, spi_port=0, gpio_DC=24, gpio_RST=25,devicetype=u'ssd1306'):

		
		self.spi_port = spi_port
		self.spi_device = spi_device
		self.gpio_DC = gpio_DC
		self.gpio_RST = gpio_RST

		self.rows = rows
		self.cols = cols

		self.fb = [[]]

		# Initialize the default font
		font = fonts.bmfont.bmfont('latin1_5x8_fixed.fnt')
		self.fp = font.fontpkg

		#serial = i2c(port=spi_port, address=spi_device)
		
		serial = spi (port = spi_port, device = spi_device, gpio_DC = gpio_DC, gpio_RST = gpio_RST)

		if devicetype.lower() == u'ssd1306':
			self.device = ssd1306(serial)
		elif devicetype.lower() == u'sh1106':
			self.device = sh1106(serial)
		elif devicetype.lower() == u'ssd1322':
			self.device = ssd1322(serial)
		elif devicetype.lower() == u'ssd1325':
			self.device = ssd1325(serial)
		elif devicetype.lower() == u'ssd1331':
			self.device = ssd1331(serial)
		else:
			raise ValueError('{0} not a recognized luma device type'.format(devicetype))
Esempio n. 14
0
def main():
    time_counter = 0

    # define our i2c LED location
    serial = i2c(port=1, address=0x3C)

    # We have an ssd1306 device so we initialize it at the 
    # serial address we created.
    oled_device = ssd1306(serial)

    # This line keeps the display from immediately turning off once the
    # script is complete.
    oled_device.cleanup = do_nothing

    while True:
	# Update our LED
        stats(oled_device)

	# Every 5 minutes post up to our production site.
	# Feel free to change this or eliminate this during testing.
        if (time_counter % 300 == 0):
            report()

	# Increment a counter (1 per second. 5 here since we sleep 5 below)
        time_counter += 5

	# Sleep 5 seconds
        time.sleep(5)
Esempio n. 15
0
    def setup(self, i2c_address=0x3C):
        self.serial = i2c(port=1, address=i2c_address)
        self.device = ssd1306(self.serial)

        # font configuration
        self.ttf = '/usr/share/fonts/truetype/04B_03__.TTF'
        basedir = os.path.dirname(os.path.realpath(__file__))
        self.imagedir = os.path.join(basedir, 'images')
        self.font8 = ImageFont.truetype(self.ttf, 8)
        self.font16 = ImageFont.truetype(self.ttf, 16)
        self.font32 = ImageFont.truetype(self.ttf, 32)
        self.tempFont32 = ImageFont.truetype("/usr/share/fonts/truetype/noto/NotoMono-Regular.ttf", 32)

        # logging
        self.lines = []
        self.lineNumber = 0
        
        # target user found.
        self.name = ""
        self.temp = ""
        self.measureProgress = 0 # 0 to 100 %
        self.result = None

        # flags
        self.isShutdown = False
        self.status = "BOOT"        

        #start the screen refresh thread
        self.th = threading.Thread(target=self.refreshThread, args=())
        self.th.start()
Esempio n. 16
0
    def set_address(self, address):
        super(terrariumOLED, self).set_address(address)
        try:
            address = i2c(port=int(self.bus),
                          address=int('0x' + str(self.address), 16))

            if self.get_type() == terrariumOLEDSSD1306.TYPE:
                self.device = ssd1306(address)
            elif self.get_type() == terrariumOLEDSSD1309.TYPE:
                self.device = ssd1309(address)
            elif self.get_type() == terrariumOLEDSSD1322.TYPE:
                self.device = ssd1322(address)
            elif self.get_type() == terrariumOLEDSSD1325.TYPE:
                self.device = ssd1325(address)
            elif self.get_type() == terrariumOLEDSSD1327.TYPE:
                self.device = ssd1327(address)
            elif self.get_type() == terrariumOLEDSSD1331.TYPE:
                self.device = ssd1331(address)
            elif self.get_type() == terrariumOLEDSSD1351.TYPE:
                self.device = ssd1351(address)
            elif self.get_type() == terrariumOLEDSH1106.TYPE:
                self.device = sh1106(address)

        except DeviceNotFoundError as ex:
            print(
                '%s - WARNING - terrariumDisplay     - %s' %
                (datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S,%f')[:23],
                 ex))
            self.device = None

        self.init()
Esempio n. 17
0
 def __init__(self):
     serial = i2c(port=1, address=0x3c)
     self.device = ssd1306(serial, height=32)
     self.device.persist = True
     self.font = self.make_font("arial.ttf", 11)
     print("OLEDbar.__init__> all set. Max bars = ", OLEDbar.bars)
     self.regulator = framerate_regulator(fps=60)
     self.readtime = []
Esempio n. 18
0
def test_init_96x16():
    ssd1306(serial, width=96, height=16)
    serial.command.assert_has_calls([
        # Initial burst are initialization commands
        call(174, 213, 96, 168, 15, 211, 0, 64, 141, 20, 32, 0,
             161, 200, 218, 2, 217, 241, 219, 64, 164, 166),
        # set contrast
        call(129, 207),
        # reset the display
        call(33, 0, 95, 34, 0, 1),
        # called last, is a command to show the screen
        call(175)
    ])

    # Next 192 are all data: zero's to clear the RAM
    # (192 = 96 * 16 / 8)
    serial.data.assert_called_once_with([0] * (96 * 16 // 8))
Esempio n. 19
0
def test_init_128x32():
    ssd1306(serial, width=128, height=32)
    serial.command.assert_has_calls([
        # Initial burst are initialization commands
        call(174, 213, 128, 168, 31, 211, 0, 64, 141, 20, 32, 0,
             161, 200, 218, 2, 217, 241, 219, 64, 164, 166),
        # set contrast
        call(129, 207),
        # reset the display
        call(33, 0, 127, 34, 0, 3),
        # called last, is a command to show the screen
        call(175)
    ])

    # Next 512 are all data: zero's to clear the RAM
    # (512 = 128 * 32 / 8)
    serial.data.assert_called_once_with([0] * (128 * 32 // 8))
Esempio n. 20
0
	def _init_display_device(self):
		# Init Device
		self.serial = i2c(port=1, address=0x3C)
		self.device = ssd1306(self.serial)

		# Setup & Start Display Loop Thread 
		display_thread = threading.Thread(target=self._display_loop)
		display_thread.start()
Esempio n. 21
0
def test_show():
    """
    SSD1306 OLED screen content can be displayed.
    """
    device = ssd1306(serial)
    serial.reset_mock()
    device.show()
    serial.command.assert_called_once_with(175)
Esempio n. 22
0
def test_hide():
    """
    SSD1306 OLED screen content can be hidden.
    """
    device = ssd1306(serial)
    serial.reset_mock()
    device.hide()
    serial.command.assert_called_once_with(174)
Esempio n. 23
0
def test_init_128x64():
    ssd1306(serial)
    serial.command.assert_has_calls([
        # Initial burst are initialization commands
        call(174, 213, 128, 168, 63, 211, 0, 64, 141, 20, 32, 0,
             161, 200, 218, 18, 217, 241, 219, 64, 164, 166),
        # set contrast
        call(129, 207),
        # reset the display
        call(33, 0, 127, 34, 0, 7),
        # called last, is a command to show the screen
        call(175)
    ])

    # Next 1024 are all data: zero's to clear the RAM
    # (1024 = 128 * 64 / 8)
    serial.data.assert_called_once_with([0] * (128 * 64 // 8))
Esempio n. 24
0
def print_result(indent, result):
    serial = i2c(port=1, address=0x3C)
    device = ssd1306(serial)
    device.clear()
    with canvas(device) as draw:
        draw.rectangle(device.bounding_box, outline="white", fill="black")
        x = device.bounding_box[2]
        y = device.bounding_box[3]
        draw.text((int(x / 2) - indent, int(y / 2)), result, fill="white")
Esempio n. 25
0
    def __init__(self):

        if import_success:
            serial = i2c(port=1, address=0x3C)
            self.disp = ssd1306(serial, rotate=0, height=32, width=128)
            self.disp.cleanup = do_nothing
            self.disp.clear()
        else:
            logger.warning("No display modules found, running in dummy mode")
Esempio n. 26
0
def init_display():
    try:
        global serial
        global device
        serial = i2c(port=1, address=0x3C)
        device = ssd1306(serial, rotate=0)
        return True
    except Exception as e:
        return str(e)
Esempio n. 27
0
    def __init__():
        # rev.1 users set port=0
        # substitute spi(device=0, port=0) below if using that interface
        serial = i2c(port=I2CPORT, address=I2CADDRESS)

        # substitute ssd1331(...) or sh1106(...) below if using that device
        device = ssd1306(serial)

        t_greating = threading.Thread(target=showText(30, 40, "DACSYS"))
        t_greating.start()
Esempio n. 28
0
    def __init__(self):
        # init device
        serial = i2c(port=1, address=0x3C)
        self.device = ssd1306(serial, width=128, height=32, rotate=0)

        # init fonts
        font_path = '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf'
        self.font = ImageFont.truetype(font_path, 16)
        self.font_medium = ImageFont.truetype(font_path, 12)
        self.font_small = ImageFont.truetype(font_path, 8)
Esempio n. 29
0
def test_init_64x32():
    """
    SSD1306 OLED with a 64 x 32 resolution works correctly.
    """
    ssd1306(serial, width=64, height=32)
    serial.command.assert_has_calls([
        # Initial burst are initialization commands
        call(174, 213, 128, 168, 31, 211, 0, 64, 141, 20, 32, 0,
             161, 200, 218, 18, 217, 241, 219, 64, 164, 166),
        # set contrast
        call(129, 207),
        # reset the display
        call(33, 32, 95, 34, 0, 3),
        # called last, is a command to show the screen
        call(175)
    ])

    # Next bytes are all data: zero's to clear the RAM
    serial.data.assert_called_once_with([0] * (64 * 32 // 8))
Esempio n. 30
0
    def __init_ssd1306(self, height):
        '''
        Memo
        ====

        Use device=0 when connecting CS of display to P01-24 (GPIO 8 [CE0]).
        '''
        serial = spi(device=0, port=0)
        device = ssd1306(serial, width=self.width, height=height)
        return device
Esempio n. 31
0
	def __init__(self, rows=64, cols=128, i2c_address=0x3d, i2c_port=1):

		self.i2c_address = i2c_address
		self.i2c_port = i2c_port

		self.rows = rows
		self.cols = cols

		self.fb = [[]]

		# Initialize the default font
		font = fonts.bmfont.bmfont('latin1_5x8_fixed.fnt')
		self.fp = font.fontpkg

		serial = i2c(port=i2c_port, address=i2c_address)
		self.device = ssd1306(serial)
Esempio n. 32
0
    def run(self):
        font2 = ImageFont.truetype('/etc/stratux-screen/CnC_Red_Alert.ttf', 12)
        serial = i2c(port=1, address=0x3c)
        oled = ssd1306(serial)

        with canvas(oled) as draw:
            logo = Image.open('/etc/stratux-screen/stratux-logo-64x64.bmp')
            draw.bitmap((32, 0), logo, fill=1)

        time.sleep(10)
        n = 0

        while 1:
            time.sleep(1)
            response = urllib2.urlopen('http://localhost/getStatus')
            getStatusHTML = response.read()
            getStatusData = json.loads(getStatusHTML)
            CPUTemp = getStatusData["CPUTemp"]
            uat_current = getStatusData["UAT_messages_last_minute"]
            uat_max = getStatusData["UAT_messages_max"]
            es_current = getStatusData["ES_messages_last_minute"]
            es_max = getStatusData["ES_messages_max"]
    
            response = urllib2.urlopen('http://localhost/getTowers')
            getTowersHTML = response.read()
            getTowersData = json.loads(getTowersHTML)
            NumTowers = 0
            for towerLatLng in getTowersData:
                print getTowersData[towerLatLng]["Messages_last_minute"]
                if (getTowersData[towerLatLng]["Messages_last_minute"] > 0):
                    NumTowers += 1

            with canvas(oled) as draw:
                pad = 2 # Two pixels on the left and right.
                text_margin = 25
                # UAT status.
                draw.text((50, 0), "UAT", font=font2, fill=255)
                # "Status bar", 2 pixels high.
                status_bar_width_max = oled.width - (2 * pad) - (2 * text_margin)
                status_bar_width = 0
                if uat_max > 0:
                    status_bar_width = int((float(uat_current) / uat_max) * status_bar_width_max)
                draw.rectangle((pad + text_margin, 14, pad + text_margin + status_bar_width, 20), outline=255, fill=255) # Top left, bottom right.
                # Draw the current (left) and max (right) numbers.
                draw.text((pad, 14), str(uat_current), font=font2, fill=255)
                draw.text(((2*pad) + text_margin + status_bar_width_max, 14), str(uat_max), font=font2, fill=255)
                # ES status.
                draw.text((44, 24), "1090ES", font=font2, fill=255)
                status_bar_width = 0
                if es_max > 0:
                    status_bar_width = int((float(es_current) / es_max) * status_bar_width_max)
                draw.rectangle((pad + text_margin, 34, pad + text_margin + status_bar_width, 40), outline=255, fill=255) # Top left, bottom right.
                # Draw the current (left) and max (right) numbers.
                draw.text((pad, 34), str(es_current), font=font2, fill=255)
                draw.text(((2*pad) + text_margin + status_bar_width_max, 34), str(es_max), font=font2, fill=255)
                # Other stats.
                seq = (n / 5) % 2
                t = ""
                if seq == 0:
                    t = "CPU: %0.1fC, Towers: %d" % (CPUTemp, NumTowers)
                if seq == 1:
                    t = "GPS Sat: %d/%d/%d" % (getStatusData["GPS_satellites_locked"], getStatusData["GPS_satellites_seen"], getStatusData["GPS_satellites_tracked"])
                    if getStatusData["GPS_solution"] == "GPS + SBAS (WAAS / EGNOS)":
                        t = t + " (WAAS)"
                #print t
                draw.text((pad, 45), t, font=font2, fill=255)

            n = n+1
Esempio n. 33
0
#!/usr/bin/env python

from luma.core.interface.serial import i2c
from luma.core.render import canvas
from luma.oled.device import ssd1306

serial = i2c(port=1, address=0x3C)
device = ssd1306(serial)
device.cleanup = lambda _: None

with canvas(device) as draw:
    draw.rectangle(device.bounding_box, outline="white", fill="black")
    draw.text((30, 40), "Hello World", fill="white")
Esempio n. 34
0
def main():
    oled = ssd1306(port=1, address=0x3C)
    while True:
	stats(oled)
        time.sleep(5)