xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

树莓派上使用 Python 编程控制 LED 教程 All In One

树莓派上使用 Python 编程控制 LED 教程 All In One

树莓派

树莓派 3B

LED

image

长腿正极 +
短腿负极 -

电阻

1个 220 欧姆的电阻,目的防止 LED 被烧坏了

面包板

1个

跳线

2根公对母跳线

GPIO 编程

引脚

image

image

Microsoft MakeCode for micro:bit

image

https://makecode.microbit.org/#editor

image

  1. Block

image

  1. JavaScript
basic.forever(function () {
    basic.showLeds(`
        . # . # .
        # . # . #
        # . . . #
        . # . # .
        . . # . .
        `)
    basic.showLeds(`
        . . . . .
        . . # . .
        . # # # .
        . . # . .
        . . . . .
        `)
})
  1. Python
def on_forever():
    basic.show_leds("""
        . # . # .
                # . # . #
                # . . . #
                . # . # .
                . . # . .
    """)
    basic.show_leds("""
        . . . . .
                . . # . .
                . # # # .
                . . # . .
                . . . . .
    """)
basic.forever(on_forever)

https://makecode.microbit.org/github

web usb

image

https://makecode.microbit.org/device/usb

Monaco Editor => vscode

The Monaco Editor is the code editor that powers VS Code.

https://microsoft.github.io/monaco-editor/

https://github.com/microsoft/monaco-editor

https://github.com/microsoft/vscode

WiFi & ip address

image

image

Fing

Network scanner & device blocking app for Internet security

用于 Internet 安全的网络扫描仪和设备阻止应用程序

image

https://www.fing.com/

https://apps.apple.com/us/app/fing-network-scanner/id430921107

https://play.google.com/store/apps/details?id=com.overlook.android.fing&hl=en_US

https://en.wiktionary.org/wiki/fing

一款可编程电流 LED 软灯带

Abstract
一款可编程电流LED软灯带,适用于各种广告标识牌背光、景观轮廓亮化等场合,此款可编程电流LED软灯带采用直流供电、FPC双层软板结构,单块FPC双层软板为一条LED支路,多块FPC双层软板间通过硅胶导线连接,每条LED支路包含由无源器件组成的恒流驱动电路,每条LED支路含3颗LED贴片光源,恒流驱动电路由多元双极型晶体管BC807U与贴片电阻组成。本实用新型的有益效果是,通过增加可编程的恒流驱动电路,可保证LED软灯带在输入电压波动长距离使用等因素影响下,均能稳定工作、发光均匀,且可通过编程电流值设定LED亮度

https://patents.google.com/patent/CN204482079U/zh

demos

microbit-Fun-with-Radio.hex

https://makecode.microbit.org/?ICID=I-LP-CTA-MICROBIT-LAUNCH-GLOBAL-NOV-FY21-WF2226765#editor

input.onButtonPressed(Button.A, function () {
    radio.sendString(":)")
})
radio.onReceivedString(function (receivedString) {
    basic.showString(receivedString)
})
radio.setGroup(1)
basic.forever(function () {
  //
})

def on_button_pressed_a():
    radio.send_string(":)")
input.on_button_pressed(Button.A, on_button_pressed_a)

def on_received_string(receivedString):
    basic.show_string(receivedString)
radio.on_received_string(on_received_string)

radio.set_group(1)

def on_forever():
    pass
basic.forever(on_forever)


image

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs

https://github.com/xgqfrms/fun-with-radio/

https://abc.xgqfrms.xyz/fun-with-radio/



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2023-03-27 12:55  xgqfrms  阅读(140)  评论(8编辑  收藏  举报