GremlinWrangler
Well-known member
I was looking for something to stretch my Teensy 3.6 Beta board and set to on hard panel for the game Kerbal Space Program (build a rocket badly, try to reach space). The game is extensively modable and a mod intended for Arduino exists that streams game state information to serial, but input was limited and currently non functional under windows. This is no big deal for a Teensy since it can also be a keyboard, joystick and mouse to close the control loop and having spare serial ports could use an FTDI adapter to keep serial port static while I reprogrammed the Teensy.
So built out a panel to provide:
Multi function digital Readout with matrix showing icon for current mode
Artificial Horizon
Assorted analog gauges
Hard switches and buttons
Analog controls for docking
Indicator lights - lots of indicator lights
A number of features that should be there are currently on the cutting room floor including the still in shipping RGB LCD in place of the under size B/W one that was on the bench when this started.
What it is doing however is running a beta 3.6 unit with:
SPI for LCD
rotary encoder
Keybord matrix library with 12 buttons
two toggle switches
Two Analog reads for joystick
I2C for matrix and 7 segment displays in top row
4 analog outputs driving gauges
software SPI for LED strip making up indicators (hardware SPI supported by layout but not smart enough to have it working yet)
Hardware Serial for game state data
USB HMI code sending to game (has lock switch to disable HMI sends when coding, and also disables when game pause detected)
Assorted glue logic to drive all of the above
Plenty of pins left over for expansion
And because of the limited data coming from the game it's not only doing floating point math for rendering the artificial horizon but it has to extract the vectors for actual flight direction first.
All of this 'just worked' software wise by just throwing libraries together and have plenty of cycles left over yet to add more features without needing to do any optimisation yet.
Compile report:
Sketch uses 60,296 bytes (5%) of program storage space. Maximum is 1,048,576 bytes.
Global variables use 8,620 bytes (3%) of dynamic memory, leaving 253,524 bytes for local variables. Maximum is 262,144 bytes.
Because it can both get game state information and send inputs it can automatically do things like send keypresses to match in game toggles to hard switches, and intelligently control warning lights (vertical speed back light goes amber for negative climb rate, red where remaining AGL/rate <10 seconds of flight.
Lots of room for more features like audio,fly by wire and a second LCD as a MFD, but that has to go on hold for the moment to rebuild the physical parts of the panel to sort out boring things like LEDs and buttons needing to ocupy the same space and excess of tape holding things together.
Thanks to Paul for making the hardware that could do all of this in one go, and the software that made doing it all 'just work' together.
So built out a panel to provide:
Multi function digital Readout with matrix showing icon for current mode
Artificial Horizon
Assorted analog gauges
Hard switches and buttons
Analog controls for docking
Indicator lights - lots of indicator lights
A number of features that should be there are currently on the cutting room floor including the still in shipping RGB LCD in place of the under size B/W one that was on the bench when this started.
What it is doing however is running a beta 3.6 unit with:
SPI for LCD
rotary encoder
Keybord matrix library with 12 buttons
two toggle switches
Two Analog reads for joystick
I2C for matrix and 7 segment displays in top row
4 analog outputs driving gauges
software SPI for LED strip making up indicators (hardware SPI supported by layout but not smart enough to have it working yet)
Hardware Serial for game state data
USB HMI code sending to game (has lock switch to disable HMI sends when coding, and also disables when game pause detected)
Assorted glue logic to drive all of the above
Plenty of pins left over for expansion
And because of the limited data coming from the game it's not only doing floating point math for rendering the artificial horizon but it has to extract the vectors for actual flight direction first.
All of this 'just worked' software wise by just throwing libraries together and have plenty of cycles left over yet to add more features without needing to do any optimisation yet.
Compile report:
Sketch uses 60,296 bytes (5%) of program storage space. Maximum is 1,048,576 bytes.
Global variables use 8,620 bytes (3%) of dynamic memory, leaving 253,524 bytes for local variables. Maximum is 262,144 bytes.
Because it can both get game state information and send inputs it can automatically do things like send keypresses to match in game toggles to hard switches, and intelligently control warning lights (vertical speed back light goes amber for negative climb rate, red where remaining AGL/rate <10 seconds of flight.
Lots of room for more features like audio,fly by wire and a second LCD as a MFD, but that has to go on hold for the moment to rebuild the physical parts of the panel to sort out boring things like LEDs and buttons needing to ocupy the same space and excess of tape holding things together.
Thanks to Paul for making the hardware that could do all of this in one go, and the software that made doing it all 'just work' together.