- 普段Elixir(GenServer) を使用している
- Go(goroutine+channel) で遊んだこともある
- Rubyの並行・並列はどうなっているか知りたかった
- 分離ヒープ+メッセージ送受信の仕組み
- 真の並列実行が可能(GVLの制約を超える)
Let’s run a simple Elixir “Blinky” application on the Seeed Studio XIAO ESP32-S3 using AtomVM — a lightweight virtual machine for running Elixir and Erlang on microcontrollers.
This setup assumes a Debian-based Linux host with the following tools installed:
| #!/usr/bin/env bash | |
| # | |
| # fetch_earth_images.sh | |
| # Interactive batch download of Earth Wallpaper, IR & VIS images. | |
| # ----------------------------------------------- | |
| set -euo pipefail | |
| echo_heading() { echo -e "\n\033[34m$1\033[0m"; } | |
| echo_success() { echo -e " \033[32m✔ $1\033[0m"; } |
For those exploring [Nerves] for the first time, we recommend [Nerves Livebook]. It allows you to try out the Nerves project on real hardware without needing to build a project from scratch.
Within minutes, you'll have a [Raspberry Pi] or [Beaglebone] running Nerves. You'll be able to run code in Livebook and work through Nerves tutorials from the comfort of your browser.
No prior knowledge about the [Elixir] programming language is required. You can learn it in [Nerves Livebook].
初めて [Nerves] 試す方には[Nerves Livebook]をお勧めします。
[Nerves Livebook]という予めビルドされたファームウェアが公開されているので、それをダウンロードして[microSD カード]に焼くだけで簡単に氣樂に[Nerves]を樂しめます。[Livebook] のノートブック上で[Elixir]コードを実際に実行しながら進められるので、ウェブブラウザで快適に 楽しく[Nerves] を学べます。
[Elixir]コードを実行しますが、[Elixir]言語に関する知識は特に不要です。なぜなら、[Nerves Livebook]上で[Elixir]言語を学ぶこともできるからです。
| rpi | rpi0 | rpi2 | rpi3a | rpi3 | rpi4 | bbb | x86_64 | osd32mp1 | |
|---|---|---|---|---|---|---|---|---|---|
| OTP 25.0 | 1.19.0 | 1.19.0 | 1.19.0 | 1.19.0 | 1.19.0 | 1.19.0 | 2.14.0 | 1.19.0 | 0.10.0 |
| OTP 24.3.2 | 1.18.4 | 1.18.4 | 1.18.4 | 1.18.4 | 1.18.4 | 1.18.4 | - | 1.18.4 | 0.9.4 |
| OTP 24.2 | 1.18.3 | 1.18.3 | 1.18.3 | 1.18.3 | 1.18.3 | 1.18.3 | 2.13.4 | 1.18.3 | 0.9.3 |
| OTP 24.1.7 | 1.17.3 | 1.17.3 | 1.17.3 | 1.17.3 | 1.17.3 | 1.17.3 | 2.12.3 | 1.17.3 | 0.8.3 |
Inky pHAT is an electronic paper (ePaper / eInk / EPD) display for Raspberry Pi.
Let's do something similar to Pimoroni's Inky pHAT weather example in Elixir. Here is Pimoroni's Python code.
Underjord's Youtube video Raspberry Pi, eInk and Nerves with Livebook introduces you to the basics of Inky on Nerves firmware.