当前位置: 首页>>代码示例>>Python>>正文


Python board.SCL属性代码示例

本文整理汇总了Python中board.SCL属性的典型用法代码示例。如果您正苦于以下问题:Python board.SCL属性的具体用法?Python board.SCL怎么用?Python board.SCL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在board的用法示例。


在下文中一共展示了board.SCL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: clear

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def clear(self):
        """Clears everything displayed on the LCD.

        The following example displays, "Hello, world!", then clears the LCD.

        .. code-block:: python

            import time
            import board
            import busio
            import adafruit_character_lcd.character_lcd_i2c as character_lcd

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = character_lcd.Character_LCD_I2C(i2c, 16, 2)

            lcd.message = "Hello, world!"
            time.sleep(5)
            lcd.clear()
        """
        self._write8(_LCD_CLEARDISPLAY)
        time.sleep(0.003) 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:23,代码来源:character_lcd.py

示例2: cursor

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def cursor(self):
        """True if cursor is visible. False to stop displaying the cursor.

        The following example shows the cursor after a displayed message:

        .. code-block:: python

            import time
            import board
            import busio
            import adafruit_character_lcd.character_lcd_i2c as character_lcd

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = character_lcd.Character_LCD_I2C(i2c, 16, 2)

            lcd.cursor = True
            lcd.message = "Cursor! "
            time.sleep(5)

        """
        return self.displaycontrol & _LCD_CURSORON == _LCD_CURSORON 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:23,代码来源:character_lcd.py

示例3: blink

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def blink(self):
        """
        Blink the cursor. True to blink the cursor. False to stop blinking.

        The following example shows a message followed by a blinking cursor for five seconds.

        .. code-block:: python

            import time
            import board
            import busio
            import adafruit_character_lcd.character_lcd_i2c as character_lcd

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = character_lcd.Character_LCD_I2C(i2c, 16, 2)

            lcd.blink = True
            lcd.message = "Blinky cursor!"
            time.sleep(5)
            lcd.blink = False
        """
        return self.displaycontrol & _LCD_BLINKON == _LCD_BLINKON 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:24,代码来源:character_lcd.py

示例4: display

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def display(self):
        """
        Enable or disable the display. True to enable the display. False to disable the display.

        The following example displays, "Hello, world!" on the LCD and then turns the display off.

        .. code-block:: python

            import time
            import board
            import busio
            import adafruit_character_lcd.character_lcd_i2c as character_lcd

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = character_lcd.Character_LCD_I2C(i2c, 16, 2)

            lcd.message = "Hello, world!"
            time.sleep(5)
            lcd.display = False
        """
        return self.displaycontrol & _LCD_DISPLAYON == _LCD_DISPLAYON 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:23,代码来源:character_lcd.py

示例5: message

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def message(self):
        """Display a string of text on the character LCD.
        Start position is (0,0) if cursor_position is not set.
        If cursor_position is set, message starts at the set
        position from the left for left to right text and from
        the right for right to left text. Resets cursor column
        and row to (0,0) after displaying the message.

        The following example displays, "Hello, world!" on the LCD.

        .. code-block:: python

            import time
            import board
            import busio
            import adafruit_character_lcd.character_lcd_i2c as character_lcd

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = character_lcd.Character_LCD_I2C(i2c, 16, 2)

            lcd.message = "Hello, world!"
            time.sleep(5)
        """
        return self._message 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:26,代码来源:character_lcd.py

示例6: move_right

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def move_right(self):
        """Moves displayed text right one column.

        The following example scrolls a message to the right off the screen.

        .. code-block:: python

            import time
            import board
            import busio
            import adafruit_character_lcd.character_lcd_i2c as character_lcd

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = character_lcd.Character_LCD_I2C(i2c, 16, 2)

            scroll_message = "Scroll -->"
            lcd.message = scroll_message
            time.sleep(2)
            for i in range(len(scroll_message) + 16):
                lcd.move_right()
                time.sleep(0.5)
        """
        self._write8(_LCD_CURSORSHIFT | _LCD_DISPLAYMOVE | _LCD_MOVERIGHT) 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:25,代码来源:character_lcd.py

示例7: text_direction

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def text_direction(self):
        """The direction the text is displayed. To display the text left to right beginning on the
        left side of the LCD, set ``text_direction = LEFT_TO_RIGHT``. To display the text right
        to left beginning on the right size of the LCD, set ``text_direction = RIGHT_TO_LEFT``.
        Text defaults to displaying from left to right.

        The following example displays "Hello, world!" from right to left.

        .. code-block:: python

            import time
            import board
            import busio
            import adafruit_character_lcd.character_lcd_i2c as character_lcd

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = character_lcd.Character_LCD_I2C(i2c, 16, 2)

            lcd.text_direction = lcd.RIGHT_TO_LEFT
            lcd.message = "Hello, world!"
            time.sleep(5)
        """
        return self._direction 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:25,代码来源:character_lcd.py

示例8: left_button

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def left_button(self):
        """The left button on the RGB Character LCD I2C Shield or Pi plate.

        The following example prints "Left!" to the LCD when the left button is pressed:

        .. code-block:: python

            import board
            import busio
            from adafruit_character_lcd.character_lcd_rgb_i2c import Character_LCD_RGB_I2C

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = Character_LCD_RGB_I2C(i2c, 16, 2)

            while True:
                if lcd.left_button:
                    lcd.message = "Left!"

        """
        return not self._left_button.value 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:22,代码来源:character_lcd_rgb_i2c.py

示例9: down_button

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def down_button(self):
        """The down button on the RGB Character LCD I2C Shield or Pi plate.

        The following example prints "Down!" to the LCD when the down button is pressed:

        .. code-block:: python

            import board
            import busio
            from adafruit_character_lcd.character_lcd_rgb_i2c import Character_LCD_RGB_I2C

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = Character_LCD_RGB_I2C(i2c, 16, 2)

            while True:
                if lcd.down_button:
                    lcd.message = "Down!"

        """
        return not self._down_button.value 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:22,代码来源:character_lcd_rgb_i2c.py

示例10: right_button

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def right_button(self):
        """The right button on the RGB Character LCD I2C Shield or Pi plate.

        The following example prints "Right!" to the LCD when the right button is pressed:

        .. code-block:: python

            import board
            import busio
            from adafruit_character_lcd.character_lcd_rgb_i2c import Character_LCD_RGB_I2C

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = Character_LCD_RGB_I2C(i2c, 16, 2)

            while True:
                if lcd.right_button:
                    lcd.message = "Right!"

        """
        return not self._right_button.value 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:22,代码来源:character_lcd_rgb_i2c.py

示例11: select_button

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def select_button(self):
        """The select button on the RGB Character LCD I2C Shield or Pi plate.

        The following example prints "Select!" to the LCD when the select button is pressed:

        .. code-block:: python

            import board
            import busio
            from adafruit_character_lcd.character_lcd_rgb_i2c import Character_LCD_RGB_I2C

            i2c = busio.I2C(board.SCL, board.SDA)
            lcd = Character_LCD_RGB_I2C(i2c, 16, 2)

            while True:
                if lcd.select_button:
                    lcd.message = "Select!"

        """
        return not self._select_button.value 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:22,代码来源:character_lcd_rgb_i2c.py

示例12: test_read_value

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def test_read_value(self):
        """
        Access all sensor values as per
        https://github.com/adafruit/Adafruit_CircuitPython_BNO055/blob/bdf6ada21e7552c242bc470d4d2619b480b4c574/examples/values.py
        Note I have not successfully run this test. Possibly a hardware issue with module I have.
        See https://forums.adafruit.com/viewtopic.php?f=60&t=131665
        """
        import board

        gc.collect()
        import adafruit_bno055

        gc.collect()
        i2c = I2C(board.SCL, board.SDA)
        sensor = adafruit_bno055.BNO055(i2c)

        self.assertTrue(9 <= sensor.gravity <= 11)
        self.assertTrue(sensor.temperature != 0)
        self.assertTrue(sensor.acceleration != (0, 0, 0))
        self.assertTrue(sensor.magnetometer != (0, 0, 0))
        self.assertTrue(sensor.gyroscope != (0, 0, 0))
        self.assertTrue(sensor.quaternion != (0, 0, 0, 0))
        sensor.euler
        sensor.linear_acceleration 
开发者ID:adafruit,项目名称:Adafruit_Blinka,代码行数:26,代码来源:i2c.py

示例13: read_sensor

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def read_sensor(sensor):
    try:
        i2c = busio.I2C(board.SCL, board.SDA)
        sensor = adafruit_si7021.SI7021(i2c)
        temperature = sensor.temperature
        humidity = sensor.relative_humidity
        if humidity == None or temperature == None or humidity > 101:
            print("--problem reading sensor on GPIO:"+sensor_gpio+"--")
            return '-1','-1','-1'
        else:
            humidity = round(humidity,2)
            temperature = round(temperature, 2)
            logtime = datetime.datetime.now()
            return humidity, temperature, logtime
    except:
        print("--problem reading si7021")
        return '-1','-1','-1' 
开发者ID:Pragmatismo,项目名称:Pigrow,代码行数:19,代码来源:log_si7021.py

示例14: backlight

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def backlight(self):
        """Enable or disable backlight. True if backlight is on. False if backlight is off.

        The following example turns the backlight off, then displays, "Hello, world?", then turns
        the backlight on and displays, "Hello, world!"

        .. code-block:: python

            import time
            import board
            import busio
            import adafruit_character_lcd.character_lcd_i2c as character_lcd

            i2c = busio.I2C(board.SCL, board.SDA)

            lcd = character_lcd.Character_LCD_I2C(i2c, 16, 2)

            lcd.backlight = False
            lcd.message = "Hello, world?"
            time.sleep(5)
            lcd.backlight = True
            lcd.message = "Hello, world!"
            time.sleep(5)

        """
        return self._enable 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:28,代码来源:character_lcd.py

示例15: color

# 需要导入模块: import board [as 别名]
# 或者: from board import SCL [as 别名]
def color(self):
        """
        The color of the display. Provide a list of three integers ranging 0 - 100, ``[R, G, B]``.
        ``0`` is no color, or "off". ``100`` is maximum color. For example, the brightest red would
        be ``[100, 0, 0]``, and a half-bright purple would be, ``[50, 0, 50]``.

        If PWM is unavailable, ``0`` is off, and non-zero is on. For example, ``[1, 0, 0]`` would
        be red.

        The following example turns the LCD red and displays, "Hello, world!".

        .. code-block:: python

            import time
            import board
            import busio
            import adafruit_character_lcd.character_lcd_rgb_i2c as character_lcd

            i2c = busio.I2C(board.SCL, board.SDA)

            lcd = character_lcd.Character_LCD_RGB_I2C(i2c, 16, 2)

            lcd.color = [100, 0, 0]
            lcd.message = "Hello, world!"
            time.sleep(5)
        """
        return self._color 
开发者ID:adafruit,项目名称:Adafruit_CircuitPython_CharLCD,代码行数:29,代码来源:character_lcd.py


注:本文中的board.SCL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。