全文搜索结果:
- esp8266快速指南 @micropython:主要硬件平台:esp8266
- /code> **引脚** <code python> from machine import Pin p0 = Pin(0, Pin.OUT) # create output pin on GPIO0 p0.on() # set pin to "on" (high) level p0.off()
- esp32快速指南 @micropython:主要硬件平台:esp32
- code> **GPIO** <code python> from machine import Pin p0 = Pin(0, Pin.OUT) # create output pin on GPIO0 p0.on() # set pin to "on" (high) level p0.off() # set pin to "off" (
- pyboard快速指南 @micropython:主要硬件平台:stm32
- ) </code> **引脚** <code python> from pyb import Pin p_out = Pin('X1', Pin.OUT_PP) p_out.high() p_out.low() p_in = Pin('X2', Pin.IN, Pin.PULL_UP) p_in.value() # get value, 0 or
- micropython程序优化实例 @micropython:代码和程序
- 次数,计算出每秒翻转的频率。 <code python> from machine import Pin import time led = Pin('A13') N = 200000 t0 = time.ticks_us() for i in range(N): led.on() le... LED翻转放在函数中执行。 <code python> from machine import Pin import time led = Pin('A13') N = 200000 def blink_simple(n): for i in range(n): led.on()
- 使用_pio_获取更多_sigma_delta_adc输入 @micropython:开发板:rpipico:demo
- y CWE # Adc sigma delta type from machine import Pin from rp2 import PIO, StateMachine, asm_pio from t... d with max mov(x, osr) label("test_pin") # jmp(pin, "is_set") jmp(y_dec, "not_set") # just count it 1 label("not_set") #nop() .side(1) jmp(x_dec,"test_pin") .side(1) # 2 jmp("save_result") la
- lsm6ds33陀螺仪传感器 @micropython:mpy-lib:sensor
- from lsm6ds33 import LSM6DS33 from machine import Pin, I2C i2c = I2C(1, freq=400000) gyr = LSM6DS33(i2... from lsm6ds33 import LSM6DS33 from machine import Pin, I2C i2c = I2C(1, freq=400000) gyr = LSM6DS33(i2... print('A:', gyr.a_raw()) gyr.wakeup_mode(True, Pin('PA6'), GYR_IRQ) </code> ---- <code python| LSM... g<<1, 0xF1) def wakeup_mode(self, on = None, pin = None, callback = None, ths = 0x20): if
- demo @micropython:开发板:pyesp32
- python> # pyESP32 LED demo from machine import Pin from time import sleep_ms LED=Pin(12, Pin.OUT) while 1: LED(not LED()) sleep_ms(200) </code> ---- 呼吸灯 <code python> # pyESP32 Breathing lamp demo from machine import Pin, Timer, PWM LED = PWM(Pin(12), freq=1000) n = 0
- lsm303ah @micropython:mpy-lib:sensor
- from lsm303ah import LSM303AH from machine import Pin, I2C i2c = I2C(1, freq=400000) mag = LSM303AH(i2... from lsm303ah import LSM303AH from machine import Pin, I2C i2c = I2C(1, freq=400000) mag = LSM303AH(i2... toggle() print('M:', mag.m()) mag.mag_irq(1, Pin('PA5'), MAG_IRQ) </code> ---- 源码 <code python|... n self.irq_v[1] def mag_irq(self, on = None, pin = None, callback = None, ths = 0xC0): if
- 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.getALS() </code> 接近传感器(**VL** pin must connect to 3.3V before enable Proximity feat
- 用pascal开发microbit @micropython:mpy-lib:misc
- SUBARCH=armv6m'' <code pascal> const GPIO_PIN_CNF_INPUT_Disconnect = 1; GPIO_PIN_CNF_DIR_Output = 1; microbit_led_col1 = 4; microbit_led... ow1 = 13; var i : longint; begin GPIO.PIN_CNF[microbit_led_col1]:=(GPIO_PIN_CNF_INPUT_Disconnect shl 1) or GPIO_PIN_CNF_DIR_Output; GPIO.PIN
- 从deepsleep唤醒 @micropython:主要硬件平台:esp32
- _on_touch(wake) * **一个引脚电平**,esp32.wake_on_ext0(pin, level) * **多个引脚电平组合**,esp32.wake_on_ext1(pins,... 摸键** <code python> from machine import TouchPad, Pin, deepsleep import esp32 t = TouchPad(Pin(14)) t.config(500) # configure the threshold at which the pin is considered touched esp32.wake_on_touch(True) d
- 2线方式驱动ws2812 @circuitpython:其它
- troller : Din + Ground # - Data line can be a 3V3 pin but a 5V pin works better # - Only drive about 4 LEDs on a single pin # - Brightness can be only about 20% max # # 2021... se) # our 2-wire strip def leds_show(): leds.pin.value = False # drop pin low so WS2812 protocol s
- 超声波传感器us-100驱动 @microbit:micropython:驱动库
- 取温度和距离。 <code python> from microbit import uart, pin14, pin15, sleep from sys import print_exception class US100: def __init__(self, tpin=pin15, rpin=pin14): self.tx_pin = tpin self.rx_pin = rpin def distance_mm(self):
- 触摸传感 @micropython:开发板:rpipico:demo
- from machine import * from utime import * led= Pin(25, Pin.OUT) led.value(0) send= Pin(16, Pin.OUT) # via 1meg resistor connected to touch pad send.value(0) t1= Pin(17,Pin.IN) # directly c
- v1.20 @micropython:版本
- ACTSTUDIO 和 nullbits Bit-C PRO 开发板。添加了对命名引脚的支持,包括 Pin.board 和 Pin.cpu 属性,与支持此功能的其他移植版本保持一致。已实施 machine.lightsleep() 函数以及 SSL 证书时间验证,并使用更准确的公式来确定 PWM 频率和占空比。... 的错误修复。 samd 移植功能得到显著扩展,包括:带有 pins.csv 文件的命名引脚,以及 Pin.board 和 Pin.cpu 属性; ADC、PWM、DAC、SoftSPI、SoftI2C、SPI、I2C和RTC类添加到 machine 模块;引脚的 pin.irq() 方法和 OPEN_DRAI