当前位置: 首页>>代码示例>>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;未经允许,请勿转载。