Skip to content

Kotlin, Raspberry Pi, and Robots: what could possibly go worng.

License

Notifications You must be signed in to change notification settings

EAGrahamJr/kobots

Repository files navigation

KOBOTS

Kotlin, Raspberry Pi, and Robots: what could possibly go worng.

Experiments in electronics, robotics, and interacting with the "real world" with functional languages1. The "base" implementations are projected to be based on the plethora of microcomputing platforms, specifically the Raspberry Pi.

This is a learning experience for me, but it might produce something useful (I'll re-write this README if that actually happens 😃).

Just Build Kotlin Java Apache License

Parts of this project have been either archived or spun off into library-like projects:

In Memorium: 5/2006 - 2/23/2023 (Illy), 11/6/2023 (Tully)

Goodbye, my little coffee friends.

WHY????

A long, long time ago, I attended a WorldCon and went to a panel on robotics. I was captivated. However, at the time, I was attending college -- it seemed that acid-etching PCBs in a dorm room was probably not going to be a thing.

... time passes ...

Today, it's stupid easy to "build" electronics on bread-boards, not to mention HATs, shims, extenders, etc., and there's stupidly powerful microprocessors that you can build with. Like running a JVM. That's a helluva step up from hand-held DTMF-based remote controls.

So, yeah - I have a hobby now.

Usage on the Raspberry Pi

This stuff is being done on Pi's because that's what I have. Plus they're at least multi-core and can run Java without too much problem.

‼️ Make sure the i2c controller is enabled on the Raspberry Pi and that your user is in the appropriate group to access said devices:

$ ls -l /dev/i2c*
crw-rw---- 1 root i2c 89, 1 Nov 23 12:24 /dev/i2c-1
crw-rw---- 1 root i2c 89, 2 Nov 23 12:24 /dev/i2c-2

‼️ WARNING The I2C "baudrate" should also be adjusted to 400K - the default value will not be sufficient to handle everything on the I2C bus 😈

This pinout reference is also invaluable...

Libraries in Use

  • diozero - a thorough and straight-forward implementation of GPIO interface, with a wide range of standard devices to boot.2
  • kobots-devices - extensions and new devices added onto diozero, but in Kotlin.
  • kobots-parts - application level stuff using the devices -- ‼️ HIGHLY OPINIONATED :smiiling_imp:

Building

This project uses Gradle, so the only thing you need is a compatible JDK3. Additionally, because the project is Kotlin and uses the Kotlin Gradle plugin, a Kotlin installation is also not necessary.

Physical Pieces

Because I have no idea what direction any of this will take, the physical construction pieces have started with standard LEGOTM pieces, transitioning to TechnicTM. Various partial contraptions and explorations are detailed in the adhoc subproject.

Potentially useful constructs can be found in the diagrams directory. CAD drawings were produced using LeoCAD.

There's also a Google Album with more photos and videos.


1 All of the tutorials, lessons, kits, and existing libraries are predicated on C (at some level), due to the hardware interaction. I just don't want to go there anymore.
2 MIT License
3 Java 17 is currently the only one used

About

Kotlin, Raspberry Pi, and Robots: what could possibly go worng.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published