mini galaxy map

Mini Local System Map

Using an arduino, or rather a pair of arduinos for reasons I’ll describe a little later, and a TFT screen, I was able to build up a little prototype 2D map device. It renders the local star systems in 1980’s monochrome style, updating automatically as you hop between systems. Firstly, the biggest struggle was getting […]

Using an arduino, or rather a pair of arduinos for reasons I’ll describe a little later, and a TFT screen, I was able to build up a little prototype 2D map device. It renders the local star systems in 1980’s monochrome style, updating automatically as you hop between systems.

mini galaxy map
Mini Local System Map

Firstly, the biggest struggle was getting the graphics library to work. I’m no expert in microcontroller programming, but I was able to find old versions of not only the library written for the screen, but the SPI library for arduino. For one reason or another, the latest version of the SPI library was playing silly buggers. Also, I’m fairly sure the company I got the screen from isn’t trading any more, so getting hold of the library for that sadly required the use of the WayBackMachine.

Once I’d managed to get something rendering to the screen, I pretty quickly came to the conclusion that I was going to have some IO issues. I can’t quite remember if the serial port pins were taken up by the screen shield or if there was some other reason, but it seemed like I could either have the screen, or I could have serial comms to the PC, but not both.

The quickest, albeit least elegant, solution was to simply throw another arduino at the problem. I used the software serial library to link up the two arduinos and kept the USB cable plugged into the one without the screen attached. By sending data to the USB connected board, and having it pass the commands along the software serial lines to the display board, I finally had means of updating the screen from the PC.

Finally I put together a python script to monitor the network log that Elite: Dangerous writes to. That program watched the file for when new lines were added and determined whether the new lines indicated arrival in a new star system.

From there, it would execute a request to the EDSM API using the fantastic Requests library for python, and parse the resultant JSON which detailed the names and locations of nearby stars. Based on the outcome of that process, the program would construct a set of commands to send over serial to tell the map what to display.

In practice, it was little more than a neat toy as the in game map is significantly more useful than a monochrome 2D representation, but I was pleased with it nonetheless.

Leave a Reply

Your email address will not be published. Required fields are marked *