全文搜索结果:
- apds9930接近和环境光传感器 @micropython:mpy-lib:sensor
- 感器使用方法: <code python| > from machine import Pin, I2C import time import APDS9930 i2c=I2C(sda=Pin(5),scl=Pin(4)) apds = APDS9930.APDS9930(i2c) while True: time.sleep_ms(500) apds.get
- esp32快速指南 @micropython:主要硬件平台:esp32
- <code python> from machine import Pin, SoftI2C i2c = SoftI2C(scl=Pin(5), sda=Pin(4), freq=100000) i2c.scan() # scan for devices i2c.readfrom(0x3a, 4) # read 4 bytes from device with address 0x3a i2c.writeto(0x3a, '12') # write '12' to device with a
- i2c从设备的用法 @micropython:主要硬件平台:stm32
- 基本使用方法: **从设备端**: <code python> from pyb import I2C i2c=I2C(2) i2c.init(I2C.SLAVE, addr = 0x40) while 1: try: data = i2c.recv(4) except OSError a
- ds3231高精度rtc @micropython:mpy-lib:misc
- 400|}} 使用方法 <code python| > from machine import I2C, Pin import DS3231 i2c = I2C(sda = Pin(5), scl=Pin(4)) ds = DS3231.DS3231(i2c) ds.Hour(12) ds.Time() ds.Time([12,10,0]) ds.DateT
- sht20温湿度传感器 @micropython:mpy-lib:sensor
- 0|}} **使用方法** <code python> from machine import I2C import sht20 sht = sht20.SHT20(I2C(1)) print(sht.humi(sht.humi_raw())) </code> 首先读取寄存器原始值,在需要时在转换为实际... hon import const from time import sleep_ms SHT20_I2C_ADDR = const(0x40) class SHT20(): def __init__(self, i2c): self.i2c = i2c self.tb = bytear
- lsm303ah @micropython:mpy-lib:sensor
- lsm303ah import LSM303AH from machine import Pin, I2C i2c = I2C(1, freq=400000) mag = LSM303AH(i2c) mag.m() mag.a() </code> IRQ mode <code python> from lsm303ah imp
- lps22气压传感器 @micropython:mpy-lib:sensor
- .jpg|}} 使用方法 <code python> from machine import I2C import LPS22 i2c = I2C(1) lps = LPS22.LPS22(i2c) lps.get() </code> ---- 回调函数中的使用方法 <code python> from machine import I2C im
- lis2mdl @micropython:mpy-lib:sensor
- S2MDL 驱动 使用方法 <code python> from machine import I2C import LIS2MDL i2c = I2C(1) mdl = LIS2MDL.LIS2MDL(i2c) mdl.x() mdl.get() </code> IRQ 模式 <code python> from machine import I2
- lsm6ds33陀螺仪传感器 @micropython:mpy-lib:sensor
- lsm6ds33 import LSM6DS33 from machine import Pin, I2C i2c = I2C(1, freq=400000) gyr = LSM6DS33(i2c) gyr.a() gyr.g() </code> 中断模式 <code python> from lsm6ds33 import
- pcf8563实时时钟 @micropython:mpy-lib:misc
- MOS 1 实时时钟/日历芯片,支持可编程时钟输出、中断输出和低压检测。所有地址和数据通过双线双向 I2C 总线串联传输,最高速率:400 kbps。每次读写数据字节后,寄存器地址自动累加。 **主要特点... org.cn ''' from micropython import const PCF8563_I2C_ADDRESS = const(81) PCF8563_REG_CTRL1 = const... const(8) class PCF8563(): def __init__(self, i2c): self.i2c = i2c self.tb = bytearray(1) self.rb = bytearray(1) self.bu
- stts751温度传感器 @micropython:mpy-lib:sensor
- g|}} **使用方法** <code python> from machine import I2C import STTS751 i2c = I2C(1) stt = STTS751.STTS751(i2c) stt.temperature() </code> 在irq中的使用方法 <code python> from machine import
- pyboard快速指南 @micropython:主要硬件平台:stm32
- cv('hello') # send and receive 5 bytes </code> **I2C** <code python> from machine import I2C i2c = I2C('X', freq=400000) # create hardware I2c object i2c = I2C(scl='X1', sda='X2', fre
- bmp280气压传感器 @microbit:micropython:驱动库
- //www.micropython.org.cn ''' from microbit import i2c BMP280_I2C_ADDR = 0x76 class BMP280(): def __init__(self): self._T1 = self._g2r(0x88) self._T2 ... eturn dat # set reg def _sr(self, reg, dat): i2c.write(BMP280_I2C_ADDR, bytearray([reg, dat])) # get reg def _gr(self, reg): i2c.write(BMP280_I2C_
- bmp280气压传感器 @micropython:mpy-lib:sensor
- x77。 **使用方法** <code python> from machine import I2C import time import bmp280 b = bmp280.BMP280(I2C(1)) while True: time.sleep_ms(500) b.get() ... from micropython import const from machine import I2C BMP280_I2C_ADDR = const(0x76) class BMP280(): def __init__(self, i2c): self.i2c = i2c
- bme280温湿度气压传感器 @micropython:mpy-lib:sensor
- //www.micropython.org.cn """ from machine import I2C BME280_I2C_ADDR = const(0x76) class BME280(): def __init__(self, i2c): self.i2c = i2c self.dig_T1 = self.get2Reg(0x88) self.dig_T2 = self.short(sel