ikkhksvu 发表于 2024-10-10 08:16:19

教你运用Rust研发micro:bit主板


    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">microbit<span style="color: black;">包括</span>了<span style="color: black;">运用</span>Rust<span style="color: black;">研发</span>micro:bit微<span style="color: black;">掌控</span>器板创建固件所需的一切。micro:bit是BBC设计,用于英国的计算机教育,它是基于ARM架构的单板电脑。尺寸<span style="color: black;">仅有</span>火柴盒<span style="color: black;">那样</span>大,<span style="color: black;">持有</span>1个ARM Cortex-M0处理器,内置加速度传感器和磁力传感器,通信接口<span style="color: black;">包含</span>蓝牙和USB,<span style="color: black;">表示</span>屏由25个LED<span style="color: black;">构成</span>,<span style="color: black;">能够</span><span style="color: black;">表示</span>单色图案和动画。2个可编程按钮,<span style="color: black;">能够</span>用USB<span style="color: black;">或</span><span style="color: black;">外边</span>电池供电。设备输入和输出为环孔连接器和边缘连接器。micro:bit最大的特点,就在于只需连接到电脑的USB,<span style="color: black;">就可</span>马上执行。无需组装零件、安装软件、购买感测器和其它电子零件。在<span style="color: black;">无</span>电脑的<span style="color: black;">状况</span>下<span style="color: black;">亦</span><span style="color: black;">能够</span>运行,将构建好的应用复制到micro:bit之后,就<span style="color: black;">能够</span><span style="color: black;">运用</span>3V电池座连接到micro:bit的电源连接器上。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">此刻</span>,你为该设备编程需要准备:</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">一个micro:bit主板</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">一台电脑(macOS和Linux优先<span style="color: black;">选取</span>,Windows<span style="color: black;">亦</span><span style="color: black;">能够</span>)</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">当你在编程之前,需要<span style="color: black;">认识</span>到micro:bit V1和V2<span style="color: black;">运用</span>的Rust库<span style="color: black;">区别</span>,microbit对应micro:bit V1,支持<span style="color: black;">目的</span>thumbv6m-none-eabi;microbit-v2对应micro:bit V2,支持<span style="color: black;">目的</span>thumbv7em-none-eabihf。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">这些例子<span style="color: black;">运用</span>了<span style="color: black;">有些</span>工具,要运行这些例子,需要安装probe-rs和flip-link。</p><span style="color: black;"><span style="color: black;">&gt;</span>cargo install probe-rs-tools flip-link</span><span style="color: black;"><span style="color: black;">首要</span>,将你的</span><span style="color: black;">micro:bit主板连接到电脑,</span><span style="color: black;"><span style="color: black;">而后</span>运行下面的命令</span><span style="color: black;">:</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span>是micro:bit V1</p><span style="color: black;"><span style="color: black;">&gt;</span>cargo run --release --manifest-path ./examples/display-blocking/Cargo.toml --features v1 --target thumbv6m-none-eabi</span><span style="color: black;">倘若</span>是micro:bit&nbsp;V2<span style="color: black;"><span style="color: black;">&gt;</span>cargo run --release --manifest-path ./examples/display-blocking/Cargo.toml --features v2 --target thumbv7em-none-eabihf</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">你应该看到<span style="color: black;">非常多</span>构建输出,micro:bit背面的LED灯应该快速闪烁,LED<span style="color: black;">表示</span>屏上会<span style="color: black;">显现</span>一条信息。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">恭喜您,<span style="color: black;">已然</span>将<span style="color: black;">第1</span>个Rust程序写入到micro:bit闪存上了。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">无论<span style="color: black;">怎样</span>,Rust<span style="color: black;">始终</span>在向嵌入式阵地坚实的挺进,随着时间的发展,Rust在嵌入式<span style="color: black;">行业</span>的项目和应用会越来越多。<span style="color: black;">爱好</span>Rust和嵌入式的<span style="color: black;">伴侣</span>,赶快入手吧!microbit项目的Github<span style="color: black;">位置</span>:</p>https://github.com/nrf-rs/microbit最后,发个<span style="color: black;">举荐</span>:<a style="color: black;">豆子工具</a><span style="color: black;">是一个<span style="color: black;">微X</span>小程序,内含IP<span style="color: black;">位置</span><span style="color: black;">查找</span>、音频格式转换、网络调试等工具。欢迎浏览<span style="color: black;">保藏</span>。</span>




m5k1umn 发表于 2024-11-1 01:56:26

我完全赞同你的观点,思考很有深度。
页: [1]
查看完整版本: 教你运用Rust研发micro:bit主板