My Little C Extension: Lego Robots are Magic
summary
A hobby LEGO robot built on a Raspberry Pi and the BrickPi drivers becomes a Ruby-controlled robot by writing a C extension and packaging it as a gem. The process hits SD-card and wiringPi driver issues, a segfault that destroys a dev machine, then a working init and motor commands; motors spin. A first gem is released to rubygems.org, a remote-control script runs in ~45 minutes, and a simple Logo-like drawing app lets a child produce art—play leads to shipping.
AI-written summary · about
chapters (12)
- 0:00Start
- 2:53Programming
- 12:56Create a gem
- 13:08Lay filesystem groundwork
- 13:46Specify Ruby API
- 14:15Write first wrapper
- 15:45Object-oriented C
- 16:134. Build gem & experiment
- 20:27NAMESPACE ALL THE THINGS!
- 21:01Prefix C method helpers for easy identification
- 24:50Motors spin!
- 26:21rake release








