Bridge the physical world: Kotlin/Native on Raspberry Pi
summary
A hand robot that plays rock paper scissors runs on a Raspberry Pi compiled from Kotlin/Native, with working LED blink, button callbacks and I2C servo control; GPIO use relies on C interop .def files and staticCFunction callbacks, servos use a PCA9685 I2C driver with native memory scopes for pointer arguments, and the camera is driven by calling raspistill. Cross‑compilation and toolchain quirks cause friction and TensorFlow builds fail on 32‑bit Raspbian, so ML inference remains unresolved while hardware control works.
AI-written summary · about
chapters (64)
- 0:00Introduction
- 0:51The machinery
- 2:10The project
- 2:24Data collection tool
- 3:41Driver
- 4:07Robota
- 4:19Final result
- 4:35Google stops the project
- 4:45Why KotlinNative
- 5:17What is KotlinNative
- 5:37Compiler
- 6:11Intermediate representation
- 6:30Terminology
- 6:56Pi architectures
- 7:27Raspberry Pi
- 7:42Coding Native Documentation
- 8:08Crosscompilation
- 8:57C Interoperability
- 9:40My setup
- 9:51GPIO
- 10:16Starting the project
- 11:00hello calling native
- 11:19compile
- 11:38different libraries
- 12:04making it work
- 12:28creating a def file
- 13:19GPIO library
- 13:52Final code
- 14:27Linking libraries
- 15:21Binary executable
- 15:34Crossplatform coupling
- 15:55English file
- 16:13Header file
- 16:37SCP
- 16:49Advanced
- 17:21Callback
- 18:00Reading C
- 18:43Static C function
- 19:00Code
- 19:33Server motors
- 20:02SDA1 CL
- 20:15Drivers
- 20:36PWM
- 21:40C library
- 22:20initialize C library
- 22:51code encoding
- 23:21C values ref
- 24:07Documentation is not enough
- 24:18Native Placement
- 24:29Memory Allocation
- 24:59Native on Raspberry Pi
- 25:40Robot starts to work
- 26:04Camera module
- 26:43POSIX binding
- 26:55recipesteel
- 27:29tensorflow
- 29:14passdown
- 29:35long wait
- 30:01basic demo
- 30:14image capture
- 30:44conclusion
- 32:06Native
- 32:32Repository
- 33:14Debugging
related talks
36mBridge the Physical World: Kotlin/Native on Raspberry Pi
43mKotlinbots: Building Your Own Personal Robot Army
38mKotlin/Native
46mMaking Noise with Kotlin Native
40mKotlin & Implications in an IoT project
43mThe Triumphs and Tribulations of Kotlin-Native in Practice
34mHardware development with KMP and Compose Desktop
54mKotlin/Native: Answers You Won't Find on the Internet
