全文搜索结果:
- 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() led.off() t1 = time.ticks_us() dt = time.ticks_diff(t1, t0) fmt = '{:5.3f} sec, {:6.3f} usec... * 1e3)) </code> :!:我们将这段代码保存为文件led1.py,然后import led1执行。在pybv10或者pyboardCN上结果是: <code> 3.381 sec, 16.
- 2线方式驱动ws2812 @circuitpython:其它
- but a 5V pin works better # - Only drive about 4 LEDs on a single pin # - Brightness can be only about... m, time import board import neopixel, rainbowio led = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.4) # onboard LED leds = neopixel.NeoPixel(board.D5, 4, brightness=0.1, auto_write=False) # our 2-wire strip def leds_
- pyboard快速指南 @micropython:主要硬件平台:stm32
- /code> **内部LED** <code python> from pyb import LED led = LED(1) # 1=red, 2=green, 3=yellow, 4=blue led.toggle() led.on() led.off() # LEDs 3 and 4 support PWM inte
- demo @micropython:开发板:pyesp32
- ====== pyESP32 demo ====== LED <code 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> # py
- demo @circuitpython:开发板:clue:demo
- CircuitPython_NeoPixel ---- ====== 基本功能 ====== LED CLUE开发板有两组LED,正面的两个白光LED和反面的红色LED。 <code python> from adafruit_clue import clue clue.red_led = True clue.white_leds = True </code> 板载 NeoPixel RGB LED(pixel) <code python> from adafruit_clue import clue import time
- 用mbed开发microbit @microbit:misc
- 0.13控制 <code cpp> #include "mbed.h" /* * All the LEDs on the micro:bit are part of the LED Matrix, * In order to get simple blinking behaviour, we set colu... be permanently at ground. If you want to use the LEDs as * a screen, there is a display driver in the
- 用pascal开发microbit @micropython:mpy-lib:misc
- 1; GPIO_PIN_CNF_DIR_Output = 1; microbit_led_col1 = 4; microbit_led_row1 = 13; var i : longint; begin GPIO.PIN_CNF[microbit_led_col1]:=(GPIO_PIN_CNF_INPUT_Disconnect shl 1) or G... PIO_PIN_CNF_DIR_Output; GPIO.PIN_CNF[microbit_led_row1]:=(GPIO_PIN_CNF_INPUT_Disconnect shl 1) or G
- 可爱的变色led头饰 @创意diy
- d头饰_效果3.jpeg?600|}} [[https://www.hackster.io/alexandracovor/circuit-sculpture-led-tiara-50aad7|项目链接]]
- programmable_io @micropython:开发板:rpipico:demo
- n import time @asm_pio(set_init=PIO.OUT_LOW) def led_quarter_brightness(): set(pins, 0) [2] set(pins, 1) @asm_pio(set_init=PIO.OUT_LOW) def led_half_brightness(): set(pins, 0) set(pins, 1) @asm_pio(set_init=PIO.OUT_HIGH) def led_full_brightness(): set(pins, 1) sm1 = StateMachine(1, led_quarter_brightness, freq=10000, set_base=Pin(25))
- gobot_-_microbit_的_golang_framework @microbit:misc
- 不同的驱动程序,每个驱动程序对应不同的功能: * 加速计 * 按键 * IO * LED * 磁力计 * 温度 **LEDDriver** <code go> package main import ( "os" "time" "... button := gpio.NewButtonDriver(ubit, "0") led := gpio.NewLedDriver(ubit, "1") work := ... func(data interface{}) { led.On() }) button.On
- 用microbit控制树莓派的gpio @microbit:趣味程序:micropython
- python> import serial, time from gpiozero import LED port = "/dev/ttyACM0" baud = 115200 led = LED(18) while True: s = serial.Serial(port) s.baudrate = baud data = s.readline() data = str(data) if "on" in data: led.on() print("On") </code> 最后在树莓派的GPIO上连接电
- 番茄定时器 @microbit:趣味程序:makecode
- 界面 按下A键,启动番茄定时器,并显示番茄定时器的序号。 每个LED代表一分钟,开始的时候,LED是全亮的,然后每分钟熄灭一个LED。 最后一分钟的时候,LED会通过闪烁吸引你的注意力,因为microbit没有蜂鸣器发声(newbit上有,可以非常容易修改发声) 任何时候可以按下B键休息,这时L
- 闪灯 @micropython:开发板:rpipico:demo
- 从手册上可以看到,LED使用了GPIO25,所以可以通过将GPIO25设置为输出控制LED。 <code python> from machine import Pin LED=Pin(25,Pin.OUT) LED(1) LED(0) </code>
- scrollbit_17x7_led阵列 @microbit:相关产品
- ====== scroll:bit 17x7 LED阵列 ====== scroll:bit是一个小巧的像素屏,它有119个的LED,非常适合用于micro:bit信息的滚动消息,或者用于动画,图标等等... 17x7 高亮的像素阵列 * 独立的PWM亮度控制每个像素 * 使用IS31FL3731 LED 阵列驱动芯片 * 与micro:bit兼容 * 支持MakeCode和MicroPytho