TinyGo & TinyGo Keeb & …
TinyGo Conference 2025 in JAPAN
2025/10/12
Masaaki Takasago
# お前だれよ?
今日の内容 / Topics
hashtag: #tinygo_conf
TinyGo Keeb とは / What is TinyGo Keeb
自作キーボード + TinyGo でいろんな楽しいことをしていくためのコミュニティ。主な活動は以下。
hashtag: #tinygo_conf
TinyGo Keeb Tour とは / What is TinyGo Keeb Tour
This event focuses on custom keyboards, with soldering activities in the morning and software (TinyGo) programming in the afternoon. You can enjoy writing your own unique applications or games.
はんだ付けの様子 (2025 in Osaka)
hashtag: #tinygo_conf
TinyGo Keeb Tour とは / What is TinyGo Keeb Tour
A chance to get to know embedded systems and TinyGo.
A chance to experience soldering and hands-on making.
A chance to discover delicious food and drinks from all over Japan.
hashtag: #tinygo_conf
TinyGo Keeb Tour とは / What is TinyGo Keeb Tour
Already held 8 times in 7 locations across Japan 👏
hashtag: #tinygo_conf
TinyGo Keeb Tour とは / What is TinyGo Keeb Tour
For more details:
�TinyGo Keeb Tour 2024 というイベントの紹介
Introduction to the event “TinyGo Keeb Tour 2024”
2026 年もまだまだ続きます。近所で開催したい人は是非スタッフや私 (sago35) に声をかけてください。 X:sago35tk でも OK です。
hashtag: #tinygo_conf
TinyGo Keeb Tour とは / What is TinyGo Keeb Tour
TinyGo Keeb Tour で使用しているハードウェア zero-kb02 も展示しています。
ロータリーエンコーダーをまわしてみる、ゲームをプレイしてみる、など是非触ってみてください。 Web からの設定なども面白いですよ。
hashtag: #tinygo_conf
TinyGo Keeb Tour とは / What is TinyGo Keeb Tour
We’re also exhibiting the hardware used in the TinyGo Keeb Tour — the `zero-kb02`.
Try turning the rotary encoder, playing some games, and more!
It’s also fun to try configuring it via the web—come check it out!
hashtag: #tinygo_conf
TinyGo の基本 / Basics of TinyGo
オープニングセッションとして、 TinyGo とは?というあたりも含めて基本をおさらいしていこうと思います。
As part of the opening session, we’ll go over the fundamentals—including “What is TinyGo?”—to review the basics together.
hashtag: #tinygo_conf
Go の話
Talk about Go
hashtag: #tinygo_conf
質問! / Question!
Go を知ってる人
Do you know Go?
hashtag: #tinygo_conf
質問! / Question!
Go を
書いた事がある人�Who here has written Go before?
hashtag: #tinygo_conf
Go とは (ChatGPT より) / What is Go?
hashtag: #tinygo_conf
Go の好きなところ / What I like about Go
The Go gopher was designed by Renée French.
hashtag: #tinygo_conf
Hello, 世界
hashtag: #tinygo_conf
Concurrency (goroutine)
Prefixing with `go` enables asynchronous execution (also available in TinyGo)
Runs every 500ms
Runs every 1200ms
hashtag: #tinygo_conf
Concurrency (ex: sleep sort)
Implementing sleep sort is easy too!
hashtag: #tinygo_conf
About Go
hashtag: #tinygo_conf
TinyGo の話�Talk about TinyGo
hashtag: #tinygo_conf
質問! / Question!
TinyGo を
書いたことがある人�Who here has written Go before?
hashtag: #tinygo_conf
TinyGo とは
What is TinyGo
hashtag: #tinygo_conf
TinyGo とは / What is TinyGo
hashtag: #tinygo_conf
TinyGo とは / What is TinyGo
ざっくり書くと
Roughly speaking:
hashtag: #tinygo_conf
Hello World
The basic "Hello, World" program looks like this. The same code runs both on Go for your computer and TinyGo for microcontrollers.
$ go run .
hello world!
hello world!
hello world!
$ tinygo flash --target wioterminal --size short --monitor .
code data bss | flash ram
10836 148 6680 | 10984 6828
Connected to COM5. Press Ctrl-C to exit.
hello world!
hello world!
hello world!
hashtag: #tinygo_conf
L チカしてみよう / Let’s try blinking an LED
The "Hello, World!" of embedded development and microcontroller tinkering is blinking an LED—known as *Lチカ* in Japanese. This code works without modification across different microcontrollers or boards, as long as they have an LED.
Definitions for each microcontroller and board
These exist only in TinyGo and are not included in standard Go
Microcontroller Configuration
Here, we’re setting it as an output port
Repeat the process of toggling the LED and waiting for 500 ms
hashtag: #tinygo_conf
Concurrency (goroutine)
Goroutines work in TinyGo as well. The key point is that they run without an OS.
Runs every 500ms
Runs every 1200ms
hashtag: #tinygo_conf
Difference in file size between Go and TinyGo
Even with the simple "Hello, World" program shown earlier, you can see that the binary created with TinyGo is significantly smaller. This makes it possible to run on microcontrollers with limited ROM and RAM.
$ go build -o main.exe .
$ tinygo build -o main_tinygo.exe .
$ ls -l *.exe
-rwxr-xr-x 1 sago3 197609 2003456 9月 11 21:02 main.exe
-rwxr-xr-x 1 sago3 197609 304128 9月 11 21:02 main_tinygo.exe
$ strip *.exe
$ ls -l *.exe
-rwxr-xr-x 1 sago3 197609 1426944 9月 11 21:02 main.exe
-rwxr-xr-x 1 sago3 197609 33792 9月 11 21:02 main_tinygo.exe
hashtag: #tinygo_conf
Microcontrollers supported by TinyGo
TinyGo supports a wide range of microcontrollers, with especially strong support for:
However, please note that popular microcontrollers like the ESP32 / ESP32-C3 are not yet supported for standalone network functionality.
hashtag: #tinygo_conf
Features / Peripherals Supported by TinyGo
Support varies by microcontroller, but core features are already supported, including:
Missing features?
Contributions (PRs) are welcome!
hashtag: #tinygo_conf
Drivers for various devices are also available!
You can find a variety of drivers at `tinygo-org/x/drivers`, including:
And many more!
hashtag: #tinygo_conf
TinyGo + net/http
Network functionality via HCI (Host Controller Interface), such as WiFi and BLE, is implemented.
Aside from the need for hardware initialization, the code is the same as in standard Go. However, not all features are available.
Host Microcontroller
Example: `ATSAMD51`
Communication Microcontroller
Example: `ESP32`
HCI
hashtag: #tinygo_conf
TinyGo + net/http
Unlike on a PC, initializing the WiFi interface is necessary when connecting from a microcontroller.
link, _ := probe.Probe()
err := link.NetConnect(&netlink.ConnectParams{
Ssid: ssid,
Passphrase: pass,
})
hashtag: #tinygo_conf
TinyGo + net/http
After that, you can use standard functions like `net/http.Get()` as usual.
resp, _ := http.Get("https://httpbin.org/get")
io.Copy(os.Stdout, resp.Body)
hashtag: #tinygo_conf
TinyGo で
何が作れる?�What Can You Build with TinyGo?
hashtag: #tinygo_conf
awesome-tinygo : many examples are available!
hashtag: #tinygo_conf
Here’s what you can create with TinyGo (1)
Handle Controller (@nobonobo)
Includes force feedback, so the steering gets heavier when cornering
Actually usable with PC games like `EA Sports WRC` and `DiRT Rally 2.0`
https://github.com/nobonobo/pico-ffb-steering-wheel
�※ It's on display today—be sure to try it out
※ Force feedback is something you have to feel to understand!
hashtag: #tinygo_conf
Here’s what you can create with TinyGo (2)
Lap Timer using Bluetooth / BLE
hashtag: #tinygo_conf
Here’s what you can create with TinyGo (3)
You can build your own custom keyboard, too!
hashtag: #tinygo_conf
Here’s what you can create with TinyGo (4)
You can even create conference badges!
YAPC::Kyoto 2023
Kyoto.go #50
hashtag: #tinygo_conf
Here’s what you can create with TinyGo (5)
You can also create things that light up!
hashtag: #tinygo_conf
Here’s what you can create with TinyGo (6)
You can make games too!
hashtag: #tinygo_conf
Here’s what you can create with TinyGo (7)
It can even become a musical instrument!
+
hashtag: #tinygo_conf
Others
There are also project examples in the TinyGo Advent Calendar 2024!
hashtag: #tinygo_conf
TinyGo の始め方 / Getting started with TinyGo
hashtag: #tinygo_conf
Getting started with TinyGo: install
Basically, just follow the official Getting Started guide.On macOS, using brew, and on Windows, using scoop is the easiest way.
hashtag: #tinygo_conf
Getting started with TinyGo: build
As shown below, use `tinygo build` to build, and `tinygo flash` to build and flash to the device.
hashtag: #tinygo_conf
Getting started with TinyGo: Hello world! / Blinky
The "Hello, World!" on microcontrollers is Blinky.
hashtag: #tinygo_conf
Getting started with TinyGo: Printf debug
You can use `println` and `fmt.Print`, among others.
困ったら fmt.Printf(“%#v”) で!
hashtag: #tinygo_conf
Getting started with TinyGo: tinygo.org/x/drivers
There are many drivers for sensors and actuators available at `tinygo.org/x/drivers`.
hashtag: #tinygo_conf
Getting started with TinyGo: refs
If you're looking for sample code, the TinyGo Keeb Tour workshop repository is a great resource.
hashtag: #tinygo_conf
TinyGo で
USB HID Keyboard を作る�Creating a USB HID Keyboard with TinyGo
hashtag: #tinygo_conf
Minimal keyboard implementation with TinyGo
Recognized as a USB HID Keyboard via `import`
Obtain the `port` for keyboard access
Use `Press` to simulate pressing and releasing the `K` key
hashtag: #tinygo_conf
Link it to a `BUTTON` input
② Create an instance-like object for the keyboard
① Define a variable to receive the key input
③ Press the `K` key in response to the button input
hashtag: #tinygo_conf
Demo
Let’s turn the `conf2025badge` into a keyboard with layer functionality!
source code : https://github.com/sago35/conf2025-demo
memo: conf2025badge
hashtag: #tinygo_conf
まとめ / Conclusion
Today’s Topics
TinyGo プロジェクトはまだまだ発展途上です。コントリビュート大歓迎です。コントリビュートに向けて、あるいは TinyGo の分からない点等は、 twitter : @sago35tk に聞いていただければサポート可能です。
hashtag: #tinygo_conf
Links
hashtag: #tinygo_conf