全文搜索结果:
- esp32快速指南 @micropython:主要硬件平台:esp32
- </code> **时间和延时** <code python> import time time.sleep(1) # sleep for 1 second time.sleep_ms(500) # sleep for 500 milliseconds time.sleep_us(10) # sleep for 10 microseconds start = time.ticks_ms
- demo @circuitpython:开发板:clue:demo
- drange(64),randrange(64),randrange(64))) time.sleep(0.1) </code> 加速度(acceleration) <code python> fr... .2f} {:.2f}".format(*clue.acceleration)) time.sleep(0.1) </code> 摇晃(shake) shake(shake_threshold=30... :.2f} {:.2f} {:.2f}".format(*clue.gyro)) time.sleep(0.1) </code> 地磁传感器(magnetic) <code python> from... } {:.3f} {:.3f}".format(*clue.magnetic)) time.sleep(0.1) </code> 气压(pressure) <code python> from ad
- esp8266快速指南 @micropython:主要硬件平台:esp8266
- code> **时间和延时** <code python> import time time.sleep(1) # sleep for 1 second time.sleep_ms(500) # sleep for 500 milliseconds time.sleep_us(10) # sleep for 10 microseconds start = ti
- pyboard快速指南 @micropython:主要硬件平台:stm32
- ode> **定时和延时** <code python> import time time.sleep(1) # sleep for 1 second time.sleep_ms(500) # sleep for 500 milliseconds time.sleep_us(10) # sleep for 10 microseconds start = ti
- 超声波传感器us-100驱动 @microbit:micropython:驱动库
- python> from microbit import uart, pin14, pin15, sleep from sys import print_exception class US100: ... op=1, tx=self.tx_pin, rx=self.rx_pin) sleep(1) uart.write(b'\x55') t ... < 1000: t = t + 1 sleep(5) if t < 1000: uart.... , tx=self.tx_pin, rx=self.rx_pin) sleep(1) uart.write(b'\x50')
- snes_控制器 @microbit:趣味程序:micropython
- 535: print('{:016b}'.format(reading)) sleep(10) </code> 2.读取按键字典 <code python> from microb... ed Start") print("Release Start") sleep(100) elif current!=last and current==1: ... ased Start") print("Press Start") sleep(100) last = current sleep(10) </code> 3.按键列表 <code python> from microbit import * class SNES
- 麦昆的超声波驱动 @microbit:micropython:驱动库
- de python> from microbit import *from time import sleep_us from machine import time_pulse_us def dist... ep.read_digital() tp.write_digital(1) sleep_us(10) tp.write_digital(0) ts = time_puls... // 100 return ts while True: dist = distance(pin1, pin2) print(dist) sleep(500) </code>
- demo @micropython:开发板:pyesp32
- ED 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> # pyES... m machine import Pin, Timer, PWM from time import sleep_ms import os, machine, gc print('\n') print('---
- apds9930接近和环境光传感器 @micropython:mpy-lib:sensor
- ds = APDS9930.APDS9930(i2c) while True: time.sleep_ms(500) apds.getALS() </code> 接近传感器(**VL** p... 2c) apds.Proximity_Enable() while True: time.sleep_ms(500) apds.getProximity() </code> ---- 源... self.setReg(APDS9930_ENABLE, t) time.sleep_ms(3) def ALS_Enable(self, on=True):
- hcsr04超声波传感器 @microbit:micropython:驱动库
- e python> from microbit import * from time import sleep_us from machine import time_pulse_us def dist... ep.read_digital() tp.write_digital(1) sleep_us(10) tp.write_digital(0) ts = time_puls... dist = distance(pin1, pin2) print(dist) sleep(500) </code> 使用 time_pulse_us 测量脉冲宽度,然后换算成距离。需要定
- microbit萤火虫 @microbit:趣味程序:micropython
- om from microbit import display, Image, button_a, sleep # Create the "flash" animation frames. Can you w... ion after a random short # pause. sleep(random.randint(50, 350)) display.show(fla... if random.randint(0, 9) == 0: sleep(500) radio.send('flash') # a-ha </co
- 触摸传感 @micropython:开发板:rpipico:demo
- Pin(17,Pin.IN) # directly connected to touch pad sleep(1) trigLevel= 0 def getT1(): # Sensor routine g... ps needs tuning print(".",end="") sleep(0.05) print("Calibrating....") calibT1() print("... led.value(0) print(trigLevel,t1Val) # use with plotter of thonny sleep(0.05) </code>
- microbit摩尔斯码发报机 @microbit:趣味程序:micropython
- arycw: for i in x: if i == 1: sleep(space) pattern = bin(i)[3:] ... pin1.write_digital(0) sleep(di) sleep(dah) #"ABCDEF" give speeds. GHIJKLM give tones NOPQRS give channels T tutor mode
- programmable_io @micropython:开发板:rpipico:demo
- Pin(25)) while(True): sm1.active(1) time.sleep(1) sm1.active(0) sm2.active(1) time.sleep(1) sm2.active(0) sm3.active(1) time.sleep(1) sm3.active(0) </code>
- 微控制器的python时事新闻 @circuitpython
- thepsf/) - 2020-12-09, [Discord 26k members, Deep Sleep and more!](https://blog.adafruit.com/2020/12/09/i... rocontrollers-newsletter-discord-26k-members-deep-sleep-and-more-python-adafruit-circuitpython-icymi-micr