I’ve been putting off designing hardware until I’ve logged a fair bit more time in game. But that doesn’t mean I can’t work on the code for it, right?
Arduinos In Space is a library to encapsulate the OiS serial protocol and provide what I hope is a friendly, easy to use interface while still being fairly fast. As an example, here’s a demo that lights an LED when EMCON is active
#include <ArduinosInSpace.h>
const int ledPin = 13;
ObjectsInSpace OIS(Serial, 1);
void setup() {
// Open the serial connection and perform handshaking
Serial.begin(9600);
OIS.begin();
// Synchronisation phase
// We register data we want to receive, and associate it with an output pin
OIS.registerBool(EMCON_MODE, ledPin);
// Complete synchronisation and activate the link
OIS.activate();
}
void loop() {
// Check for new serial data
OIS.update();
}
All known request and command types are supported. The library includes example sketches covering sending command and requesting different kinds of data, as well as integrating with some external devices.
ArduinosInSpace is still in development, but is slowly edging towards completion. Refer to the README at https://bitbucket.org/pjhardy/arduinosinspace for installation and getting started documentation.