1 of 58

TinyGo & TinyGo Keeb & …

TinyGo Conference 2025 in JAPAN

2025/10/12

Masaaki Takasago

2 of 58

# お前だれよ?

  • Name: `Masaaki Takasago`
  • Go、 TinyGo、 Perl、 C
  • 𝕏: @sago35tk
  • GitHub: sago35
  • 車載組込ソフトエンジニア
  • TinyGo の中の人 (2020/08/19 〜)
  • Umeda.go、 kansai.pm、 Perl 入学式 in 大阪
  • 「基礎から学ぶ TinyGoの組込み開発」の著者
  • ここ最近はずっと自作キーボード作ってる

3 of 58

今日の内容 / Topics

  • What is TinyGo Keeb
  • What is the TinyGo Keeb Tour?
  • Basics of TinyGo
  • What can you build with TinyGo?
  • How to get started with TinyGo
  • Creating a USB HID Keyboard with TinyGo

hashtag: #tinygo_conf

4 of 58

TinyGo Keeb とは / What is TinyGo Keeb

自作キーボード + TinyGo でいろんな楽しいことをしていくためのコミュニティ。主な活動は以下。

  • TinyGo Keeb Tour
  • 各種イベントでワークショップ開催
  • Hosting workshops at various events
  • ソフト屋さんとハードウェアの接点を作る
  • Creating connections between software developers and hardware
  • 全国のおいしいもの/お酒を楽しむ
  • Enjoying delicious food and drinks from all over Japan

hashtag: #tinygo_conf

5 of 58

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

6 of 58

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

7 of 58

TinyGo Keeb Tour とは / What is TinyGo Keeb Tour

Already held 8 times in 7 locations across Japan 👏

  • 2024: Kobe → Tokyo → Sendai → Fukuoka
  • 2025: Takamatsu → Kanazawa → Kanazawa → Osaka

hashtag: #tinygo_conf

8 of 58

TinyGo Keeb Tour とは / What is TinyGo Keeb Tour

For more details:

TinyGo Keeb Tour 2024 というイベントの紹介

Introduction to the event “TinyGo Keeb Tour 2024”

https://sago35.hatenablog.com/entry/2024/10/29/095629

2026 年もまだまだ続きます。近所で開催したい人は是非スタッフや私 (sago35) に声をかけてください。 X:sago35tk でも OK です。

hashtag: #tinygo_conf

9 of 58

TinyGo Keeb Tour とは / What is TinyGo Keeb Tour

TinyGo Keeb Tour で使用しているハードウェア zero-kb02 も展示しています。

ロータリーエンコーダーをまわしてみる、ゲームをプレイしてみる、など是非触ってみてください。 Web からの設定なども面白いですよ。

hashtag: #tinygo_conf

10 of 58

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

11 of 58

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

12 of 58

Go の話

Talk about Go

hashtag: #tinygo_conf

13 of 58

質問! / Question!

Go を知ってる人

Do you know Go?

hashtag: #tinygo_conf

14 of 58

質問! / Question!

Go を

書いた事がある人�Who here has written Go before?

hashtag: #tinygo_conf

15 of 58

Go とは (ChatGPT より) / What is Go?

  • Released by Google in 2009
  • Simple syntax
  • Statically typed
  • Concurrency support
  • High performance
  • Cross-platform compatibility
  • Rich standard library and toolchain
  • Single binary output

hashtag: #tinygo_conf

16 of 58

Go の好きなところ / What I like about Go

  • Gopher is cute
  • goroutine works properly even�on Windows
  • `gofmt` / `goimports`
  • You can play with microcontrollers
  • You can build your own keyboard!
  • TinyGo Conference 2025!!!

The Go gopher was designed by Renée French.

hashtag: #tinygo_conf

17 of 58

Hello, 世界

hashtag: #tinygo_conf

18 of 58

Concurrency (goroutine)

Prefixing with `go` enables asynchronous execution (also available in TinyGo)

Runs every 500ms

Runs every 1200ms

hashtag: #tinygo_conf

19 of 58

Concurrency (ex: sleep sort)

Implementing sleep sort is easy too!

hashtag: #tinygo_conf

20 of 58

About Go

For more details, please check:

https://go.dev/

https://go.dev/tour/welcome/

hashtag: #tinygo_conf

21 of 58

TinyGo の話�Talk about TinyGo

hashtag: #tinygo_conf

22 of 58

質問! / Question!

TinyGo を

書いたことがある人�Who here has written Go before?

hashtag: #tinygo_conf

23 of 58

TinyGo とは

What is TinyGo

hashtag: #tinygo_conf

24 of 58

TinyGo とは / What is TinyGo

hashtag: #tinygo_conf

25 of 58

TinyGo とは / What is TinyGo

ざっくり書くと

  • Go Compiler
  • マイクロコントローラーで遊べる
  • Wasm で遊べる

Roughly speaking:

  • Go Compiler
  • Can be used to play with microcontrollers
  • Can be used to play with Wasm

hashtag: #tinygo_conf

26 of 58

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

27 of 58

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

28 of 58

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

29 of 58

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

30 of 58

Microcontrollers supported by TinyGo

TinyGo supports a wide range of microcontrollers, with especially strong support for:

  • RP2040 / RP2350
  • ATSAMD51 / ATSAMD21
  • nRF52840

However, please note that popular microcontrollers like the ESP32 / ESP32-C3 are not yet supported for standalone network functionality.

hashtag: #tinygo_conf

31 of 58

Features / Peripherals Supported by TinyGo

Support varies by microcontroller, but core features are already supported, including:

  • GPIO / ADC / DAC
  • UART / I2C / SPI / CAN
  • USB

Missing features?

Contributions (PRs) are welcome!

hashtag: #tinygo_conf

32 of 58

Drivers for various devices are also available!

You can find a variety of drivers at `tinygo-org/x/drivers`, including:

  • Displays: `ili9341`, `st7735`, `ssd1306`, …
  • Temperature sensors: `adt7410`, `bme280`, `dht11`, …
  • Accelerometers: `lis3dh`, `lsm6ds3`, `lsm9ds1`, …

And many more!

hashtag: #tinygo_conf

33 of 58

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

34 of 58

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

35 of 58

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

36 of 58

TinyGo で

何が作れる?�What Can You Build with TinyGo?

hashtag: #tinygo_conf

37 of 58

awesome-tinygo : many examples are available!

hashtag: #tinygo_conf

38 of 58

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

39 of 58

Here’s what you can create with TinyGo (2)

Lap Timer using Bluetooth / BLE

  • Detects data from a BLE transmitter attached to the vehicle using a PC set up in the pit area to measure lap times.
  • TinyGo + BLE で作る Lap Timer

hashtag: #tinygo_conf

40 of 58

Here’s what you can create with TinyGo (3)

You can build your own custom keyboard, too!

hashtag: #tinygo_conf

41 of 58

Here’s what you can create with TinyGo (4)

You can even create conference badges!

YAPC::Kyoto 2023

Kyoto.go #50

hashtag: #tinygo_conf

42 of 58

Here’s what you can create with TinyGo (5)

You can also create things that light up!

hashtag: #tinygo_conf

43 of 58

Here’s what you can create with TinyGo (6)

You can make games too!

hashtag: #tinygo_conf

44 of 58

Here’s what you can create with TinyGo (7)

It can even become a musical instrument!

+

hashtag: #tinygo_conf

45 of 58

Others

There are also project examples in the TinyGo Advent Calendar 2024!

hashtag: #tinygo_conf

46 of 58

TinyGo の始め方 / Getting started with TinyGo

  • install
  • build
  • Hello world! / Blinky
  • Printf debug
  • tinygo.org/x/drivers
  • refs

hashtag: #tinygo_conf

47 of 58

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.

https://tinygo.org/getting-started/

hashtag: #tinygo_conf

48 of 58

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

49 of 58

Getting started with TinyGo: Hello world! / Blinky

The "Hello, World!" on microcontrollers is Blinky.

hashtag: #tinygo_conf

50 of 58

Getting started with TinyGo: Printf debug

You can use `println` and `fmt.Print`, among others.

困ったら fmt.Printf(“%#v”) で!

hashtag: #tinygo_conf

51 of 58

Getting started with TinyGo: tinygo.org/x/drivers

There are many drivers for sensors and actuators available at `tinygo.org/x/drivers`.

https://github.com/tinygo-org/drivers

hashtag: #tinygo_conf

52 of 58

Getting started with TinyGo: refs

If you're looking for sample code, the TinyGo Keeb Tour workshop repository is a great resource.

  • Rotary encoder
  • LEDs (WS2812B)
  • ADC
  • Buttons

https://github.com/tinygo-keeb/workshop

hashtag: #tinygo_conf

53 of 58

TinyGo で

USB HID Keyboard を作る�Creating a USB HID Keyboard with TinyGo

hashtag: #tinygo_conf

54 of 58

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

55 of 58

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

56 of 58

Demo

Let’s turn the `conf2025badge` into a keyboard with layer functionality!

source code : https://github.com/sago35/conf2025-demo

memo: conf2025badge

  • machine.GPIO2
  • machine.GPIO29
  • machine.GPIO28

hashtag: #tinygo_conf

57 of 58

まとめ / Conclusion

Today’s Topics

  • What are TinyGo Keeb / TinyGo Keeb Tour?
  • TinyGo basics / how to get started / hands-on experience
  • Embedded development is fun!
  • Wasm / WASI is fun too!

TinyGo プロジェクトはまだまだ発展途上です。コントリビュート大歓迎です。コントリビュートに向けて、あるいは TinyGo の分からない点等は、 twitter : @sago35tk に聞いていただければサポート可能です。

hashtag: #tinygo_conf

58 of 58

Links

hashtag: #tinygo_conf