全文搜索结果:
- 超声波传感器us-100驱动 @microbit:micropython:驱动库
- array(2) while not uart.any() and t < 1000: t = t + 1 sleep(5) if t < 1000: uart.readinto(buf, 2) ... y(1) while not uart.any() and t < 1000: t = t + 1 sleep(5) if t < 1000: uart.readinto(buf, 1)
- 圆周率 @micropython:代码和程序
- c += t return c // (10 ** extra) def pi_t(n=1000): t1 = ticks_ms() pi(n) t2 = ticks_ms() print(ticks_diff(t2, t1)) print(pi(1000)) pi_t(1000) </code> 对于 circuitpython,因为time中计时方式不同,程序也需要稍作修改 <code python> from time import monotoni... print('calc', expr, ', result =', r) print('calc time:', t2 - t1) calc('calc_pi(1000)') </code>
- 圆周率计算 @micropython:开发板:rpipico:demo
- c += t return c // (10 ** extra) def pi_t(n=1000): gc.collect() t1 = ticks_ms() pi(n) ... ', ticks_diff(t2, t1), 'ms') for i in (100, 500, 1000, 5000, 10000): try: print('\nCalc {} bits pi'.format(i)) pi_t(i) except: ... its pi 17 ms Calc 500 bits pi 190 ms Calc 1000 bits pi 665 ms Calc 5000 bits pi 19950 ms
- demo @micropython:开发板:pyesp32
- e import Pin, Timer, PWM LED = PWM(Pin(12), freq=1000) n = 0 def breathing(t): global n LED.d... t breathing light!\n\n') LED = PWM(Pin(12), freq=1000) n = 0 def breathing(t): global n LED.d
- 素数计算测试 @micropython:开发板:rpipico:demo
- return 0 return 1 def list_prime(n=1000): li = [] for i in range(n): if i... li.append(i) return li def list_prime_t(n=1000): gc.collect() t1 = ticks_ms() list_p
- adkeyboard模块驱动 @microbit:micropython:驱动库
- 3],最后一个值是不按键时读出的值。以上键值的中间值作为判断标志。[832,865,903,953,1000] <code python> # 模拟5按键模块 from microbit import *... self, pin): self.vList = [832,865,903,953,1000] self.pin = pin def get_key(self):
- 无线乒乓球 @microbit:趣味程序:micropython
- ) y_direction = random.choice(directions) delay = 1000 # used as a crude timer counter = 0
- pyboard快速指南 @micropython:主要硬件平台:stm32
- ython> from pyb import Timer tim = Timer(1, freq=1000) tim.counter() # get counter value tim.freq(0.5) ... Pin('X1') # X1 has TIM2, CH1 tim = Timer(2, freq=1000) ch = tim.channel(1, Timer.PWM, pin=p) ch.pulse_w... are I2c object i2c = I2C(scl='X1', sda='X2', freq=100000) # create software I2C object i2c.scan()
- v1.22 @micropython:版本
- 捐款来自以下时区:0800、0700、0600、0500、+0000、+0100、+0200、+1000、+1100。 https://github.com/micropython/micropytho
- 软件定时器 @micropython:开发板:rpipico:demo
- = Pin(25, Pin.OUT) tm = Timer(-1) tm.init(period=1000, mode=Timer.PERIODIC, callback = lambda t: LED(no
- crc16计算测试 @micropython:开发板:rpipico:demo
- OUT) p += 128 return v def crc16_t(n=1000): gc.collect() t1 = ticks_ms() crc16(
- lsm6ds33陀螺仪传感器 @micropython:mpy-lib:sensor
- , 4) LSM6DS33_SCALEG = ('250', '125', '500', '', '1000', '', '2000') LSM6DS33_COEG = (2, 1, 4, 0, 8, 0,
- demo @circuitpython:开发板:clue:demo
- de python> for i in range(30): clue.play_tone(1000+i*50, 0.05) </code> 显示简单文字(simple_text_display)
- 简易任务调度器scheduler @micropython:library
- task1 = Task(LED) task2 = Task(pn, 1, interval = 1000) task3 = Task(pn, 2, interval = 1500) sc = Sched