O'Reilly logo

The Kerbal Player's Guide by Paris Buttfield-Addison, Alasdair Allan, Paul Fenwick, Tim Nugent, Jon Manning

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. Adding Hardware to the Game

There is only so far the keyboard can take you, only so far you can immerse yourself into the game, without having a big red flip switch with a molly guard1 and lights that blink on and off. Even today, in the age of the glass cockpit, a lot of the switches on real space hardware are firmly in the physical for psychological reasons. It just feels better.

So in this chapter we’ll be building hardware and making Kerbal Space Program talk to it. We’re going to take a look at the two most common mods used to get data in, and out, of the game: the KSPSerialIO and Telemachus mods. As you’ll see, they take very different approaches, both in the game and out of it, to accomplish that task.

Note

Some of the code in this chapter is based on example code released under the CC BY license by the developers of the KSP SerialIO mod.

On the hardware side of things, to make our lights blink on and off, we’ll use the Arduino.

Warning

This chapter covers some intermediate-to-advanced hardware topics. In order to make use of this chapter, you should have at least some experience in electronics.

The Arduino

The Arduino started off as a project to give artists access to embedded microprocessors for interactive design projects, but it may well end up in a museum as one of the building blocks of the modern world. It allows rapid, cheap prototyping for embedded systems. It turns what used to be fairly tough hardware problems into simpler software problems (and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required