全文搜索结果:
- esp8266快速指南 @micropython:主要硬件平台:esp8266
- ne import UART uart = UART(0, baudrate=9600) uart.write('hello') uart.read(5) # read up to 5 bytes </code... udrate=80000000, polarity=0, phase=0) </code> spi.write(b'12345') # write 5 bytes on MOSI buf = bytearray(4) # create a buffer spi.write_readinto(b'1234', buf) # write to MOSI and read f
- snes_控制器 @microbit:趣味程序:micropython
- eger def getReading(self): self.latch.write_digital(1) self.latch.write_digital(0) word = 0 for i in range(16): self.clock.write_digital(0) word = word + (self.data.read_digital()<<i) self.clock.write_digital(1) return word # create and r
- microbit模拟时钟 @microbit:趣味程序:makecode
- return (dat//16) * 10 + (dat%16) def write_byte(self, dat): for i in range(8): self.dio.write_digital((dat >> i) & 1) self.clk.write_digital(1) self.clk.write_digital(0) def read_byte(self): d = 0 for i i
- esp32快速指南 @micropython:主要硬件平台:esp32
- user_start() esp.flash_erase(sector_no) esp.flash_write(byte_offset, buffer) esp.flash_read(byte_offset, ... into the given buffer and output 0xff on MOSI spi.write(b'12345') # write 5 bytes on MOSI buf = bytearray(4) # create a buffer spi.write_readinto(b'1234', buf) # write to MOSI and read f
- 步进电机驱动_pca9685 @microbit:micropython:驱动库
- [0] = reg buf[1] = value self.I2C.write(0x40, buf) def i2cR(self, reg): buf ... ytearray(1) buf[0] = reg self.I2C.write(0x40, buf) return self.I2C.read(0x40, 1) ... buf[4] = (off >> 8) & 0xff self.I2C.write(0x40,buf) # 16个输出脚作数字使用(channel 0-15) def write_digital(self, channel, value): if value =
- microbit摩尔斯码发报机 @microbit:趣味程序:micropython
- display.set_pixel(2,2,9) pin1.write_digital(1) music.pitch(tone, ... display.show("-") pin1.write_digital(1) music.pitch(tone, ... display.clear() pin1.write_digital(0) sleep(di) ... with open('f.txt', 'w') as f: f.write(conf[0] + conf[1] + conf[2] + conf[3]) ex
- mpl115a1驱动 @microbit:micropython:驱动库
- def _spi_enable(self, b=True): self.cs.write_digital(0) if b else self.cs.write_digital(1) def _spi_disable(self): self._spi_enable(Fals... OEFS)) self._spi_enable(True) spi.write_readinto(self.CMD_COEFS, data) self._spi_... self): self._spi_enable(True) spi.write(self.CMD_START) self._spi_enable(False)
- max7219 @microbit:micropython:驱动库
- def _register(self, command, data): # write to display self.cs.write_digital(0) self.spi.write(bytearray([command, data])) self.cs.write_digital(1) def init(self): for command, d
- pyboard快速指南 @micropython:主要硬件平台:stm32
- rom pyb import Pin, DAC dac = DAC(Pin('X5')) dac.write(120) # output between 0 and 255 </code> **UART**... > from pyb import UART uart = UART(1, 9600) uart.write('hello') uart.read(5) # read up to 5 bytes </code... e addresses i2c.writeto(0x42, 'hello') # write 5 bytes to slave with address 0x42 i2c.readfrom(0... memory 0x10 i2c.writeto_mem(0x42, 0x10, 'xy') # write 2 bytes to slave 0x42, slave memory 0x10 </code>
- bmp280气压传感器 @microbit:micropython:驱动库
- n 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_ADDR, bytearray([reg])) t = i2c.read... t[0] # get two reg def _g2r(self, reg): i2c.write(BMP280_I2C_ADDR, bytearray([reg])) t = i2c.read
- sht20温湿度传感器 @micropython:mpy-lib:sensor
- reg, self.rb) return self.rb[0] def write(self, cmd): self.tb[0] = cmd self... ADDR, self.tb) def reset(self): self.write(0xfe) def measure(self, cmd, delay): self.write(cmd) sleep_ms(delay) self.i2c.rea
- 麦昆的超声波驱动 @microbit:micropython:驱动库
- ef distance(tp, ep): ep.read_digital() tp.write_digital(1) sleep_us(10) tp.write_digital(0) ts = time_pulse_us(ep, 1, 5000) if ts > 0
- mcp401x数字电位器 @micropython:mpy-lib:misc
- in(5), scl=Pin(4)) mcp = mcp401x.MCP401x(i2c) mcp.write(50) </code> ---- 驱动源码 <code python| mcp401x.py... earray(1) self.rb = bytearray(1) def write(self, dat): self.tb[0] = dat self
- 超声波传感器us-100驱动 @microbit:micropython:驱动库
- elf.rx_pin) sleep(1) uart.write(b'\x55') t = 0 buf = byte... in) sleep(1) uart.write(b'\x50') t = 0 bu
- spi方式驱动ws2812 @micropython:开发板:rpipico:demo
- elf.buf = bytearray([0x11] * n * 12) self.write() def _cb(self, v): a = buf_bytes.in... [i] = color def show(self): self.spi.write(self.buf) </code> 然后,就可以驱动WS2812了,使用方法和ESP32上类似