當前位置: 首頁>>代碼示例>>Python>>正文


Python framebuf.MONO_VLSB屬性代碼示例

本文整理匯總了Python中framebuf.MONO_VLSB屬性的典型用法代碼示例。如果您正苦於以下問題:Python framebuf.MONO_VLSB屬性的具體用法?Python framebuf.MONO_VLSB怎麽用?Python framebuf.MONO_VLSB使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在framebuf的用法示例。


在下文中一共展示了framebuf.MONO_VLSB屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import framebuf [as 別名]
# 或者: from framebuf import MONO_VLSB [as 別名]
def __init__(self, width, height, external_vcc):
        self.width = width
        self.height = height
        self.external_vcc = external_vcc
        self.pages = self.height // 8
        self.buffer = bytearray(self.pages * self.width)
        fb = framebuf.FrameBuffer(self.buffer, self.width, self.height, framebuf.MONO_VLSB)
        self.framebuf = fb
        # Provide methods for accessing FrameBuffer graphics primitives. This is a
        # workround because inheritance from a native class is currently unsupported.
        # http://docs.micropython.org/en/latest/pyboard/library/framebuf.html
        self.fill = fb.fill
        self.pixel = fb.pixel
        self.hline = fb.hline
        self.vline = fb.vline
        self.line = fb.line
        self.rect = fb.rect
        self.fill_rect = fb.fill_rect
        self.text = fb.text
        self.scroll = fb.scroll
        self.blit = fb.blit
        self.poweron()
        self.init_display() 
開發者ID:Wei1234c,項目名稱:SX127x_driver_for_MicroPython_on_ESP8266,代碼行數:25,代碼來源:ssd1306.py

示例2: chars

# 需要導入模塊: import framebuf [as 別名]
# 或者: from framebuf import MONO_VLSB [as 別名]
def chars(self, str, x, y):
        str_w  = self._font.get_width(str)
        div, rem = divmod(self._font.height(),8)
        nbytes = div+1 if rem else div
        buf = bytearray(str_w * nbytes)
        pos = 0
        for ch in str:
            glyph, char_w = self._font.get_ch(ch)
            for row in range(nbytes):
                index = row*str_w + pos
                for i in range(char_w):
                    buf[index+i] = glyph[nbytes*i+row]
            pos += char_w
        fb = framebuf.FrameBuffer(buf,str_w, self._font.height(), framebuf.MONO_VLSB)
        self.blit(fb,x,y,str_w,self._font.height())
        return x+str_w 
開發者ID:jeffmer,項目名稱:micropython-ili9341,代碼行數:18,代碼來源:ili934xnew.py

示例3: __init__

# 需要導入模塊: import framebuf [as 別名]
# 或者: from framebuf import MONO_VLSB [as 別名]
def __init__(self, spi, cs, dc, rst=None):
		self.spi    = spi
		self.cs     = cs   # chip enable, active LOW
		self.dc     = dc   # data HIGH, command LOW
		self.rst    = rst  # reset, active LOW

		self.height = HEIGHT  # For Writer class
		self.width = WIDTH

		self.cs.init(self.cs.OUT, value=1)
		self.dc.init(self.dc.OUT, value=0)

		if self.rst:
			self.rst.init(self.rst.OUT, value=1)

		self.buf = bytearray((HEIGHT // 8) * WIDTH)
		super().__init__(self.buf, WIDTH, HEIGHT, framebuf.MONO_VLSB)

		self.reset()
		self.init() 
開發者ID:mcauser,項目名稱:micropython-pcd8544,代碼行數:22,代碼來源:pcd8544_fb.py

示例4: __init__

# 需要導入模塊: import framebuf [as 別名]
# 或者: from framebuf import MONO_VLSB [as 別名]
def __init__(self, width, height, external_vcc):
        self.width = width
        self.height = height
        self.external_vcc = external_vcc
        self.pages = self.height // 8
        self.buffer = bytearray(self.pages * self.width)
        super().__init__(self.buffer, self.width, self.height, framebuf.MONO_VLSB)
        self.init_display() 
開發者ID:tinypico,項目名稱:tinypico-micropython,代碼行數:10,代碼來源:ssd1306.py

示例5: __init__

# 需要導入模塊: import framebuf [as 別名]
# 或者: from framebuf import MONO_VLSB [as 別名]
def __init__(self, spi, cs, dc, rst=None):
		super().__init__(spi, cs, dc, rst)
		self.buf = bytearray((HEIGHT // 8) * WIDTH)
		self.fbuf = framebuf.FrameBuffer(self.buf, WIDTH, HEIGHT, framebuf.MONO_VLSB) 
開發者ID:mcauser,項目名稱:micropython-pcd8544,代碼行數:6,代碼來源:pcd8544.py


注:本文中的framebuf.MONO_VLSB屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。