V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
gyf304

Show V2EX: Wasmino: 将 Arduino C++编译至 WASM, 并在网页上运行

  •  
  •   gyf304 ·
    gyf304 · Dec 30, 2020 · 3347 views
    This topic created in 1953 days ago, the information mentioned may be changed or developed.
    放假无聊做了一个 Arduino 的 Board Package,可以把 Arduino 代码编译到 WASM,上传至 GitHub Gist,然后在网页上跑。

    https://blog.yifangu.com/2020/12/30/wasmino-wasm-arduino-running-arduino-code-in-browser/
    6 replies    2021-01-02 18:20:07 +08:00
    jones2000
        1
    jones2000  
       Dec 30, 2020
    c++ 代码怎么编译的, 使用 Emscripten SDK 吗? 有编译配置文件吗?
    gyf304
        2
    gyf304  
    OP
       Dec 31, 2020
    @jones2000 用的是 WASI SDK 基于 clang / LLVM 的
    nilbot
        3
    nilbot  
       Dec 31, 2020 via Android
    简单 lo 了一眼,没咋过脑子,问题问蠢了请别介意:一般 Board Package 就是实现附加接口 /功能吧,你做的应该是反过来,模拟 Arduino 是么?还是说基本上也没模拟 hardware,就是个类似 emulator 的软运行环境?
    gyf304
        4
    gyf304  
    OP
       Jan 1, 2021
    @nilbot 一般 Board Package 是支持其他的板子,比如说 ESP8266 / ESP32 。所以说这确实是一个 Board Package,只不过这个 Board 物理上不存在。
    说这个是模拟也不太合适,这是利用 WebAssembly exports 重新实现了 Aruduino 的 API 。
    learningman
        5
    learningman  
       Jan 2, 2021 via Android
    emmm....Arduino 的 IDE 好像不走 proxy,想要传到 Github Gist 就要网卡代理,有没有考虑优化一下
    gyf304
        6
    gyf304  
    OP
       Jan 2, 2021
    @learningman 可以在 Sketch->Export compiled binary 把 binary 拿出来上传到其他地方。地址输入框支持 http / https / data url.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1170 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 23:08 · PVG 07:08 · LAX 16:08 · JFK 19:08
    ♥ Do have faith in what you're doing.