Initial commit - including a project file for the Star Citizen flight control panel.
This commit is contained in:
commit
132dc5c462
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*.elf
|
||||
*.hex
|
8
sc-panel/Makefile
Normal file
8
sc-panel/Makefile
Normal file
|
@ -0,0 +1,8 @@
|
|||
TARGET_BOARD=arduino:avr:nano
|
||||
COM_PORT=/dev/ttyACM0
|
||||
|
||||
build:
|
||||
arduino-cli compile -b ${TARGET_BOARD}
|
||||
|
||||
upload:
|
||||
arduino-cli upload -b ${TARGET_BOARD} -p ${COM_PORT}
|
52
sc-panel/sc-panel.ino
Normal file
52
sc-panel/sc-panel.ino
Normal file
|
@ -0,0 +1,52 @@
|
|||
#include <Joystick.h>
|
||||
#include <Mux.h>
|
||||
|
||||
using namespace admux;
|
||||
|
||||
Joystick joystick;
|
||||
|
||||
void setup() {
|
||||
Mux* mux = new Mux(Pin(A4, INPUT_PULLUP, PinType::Digital), Pinset(A5, A6, A7));
|
||||
|
||||
// Power switches
|
||||
joystick.AddButton(2, BUTTON_PULSED_DOUBLE_ACTION_SPLIT);
|
||||
joystick.AddButton(3, BUTTON_PULSED_DOUBLE_ACTION_SPLIT);
|
||||
joystick.AddButton(4, BUTTON_PULSED_DOUBLE_ACTION_SPLIT);
|
||||
joystick.AddButton(5, BUTTON_PULSED_DOUBLE_ACTION_SPLIT);
|
||||
|
||||
// HUD modes
|
||||
joystick.AddButton(6, BUTTON_PASSTHRU);
|
||||
joystick.AddButton(7, BUTTON_PASSTHRU);
|
||||
joystick.AddButton(8, BUTTON_PASSTHRU);
|
||||
|
||||
// Encoders
|
||||
joystick.AddEncoder(9, 10, ENCODER_PULSED_SPLIT);
|
||||
joystick.AddEncoder(11, 12, ENCODER_PULSED_SPLIT);
|
||||
|
||||
// Mining Modules
|
||||
joystick.AddButton(13, BUTTON_PASSTHRU);
|
||||
joystick.AddButton(A0, BUTTON_PASSTHRU);
|
||||
joystick.AddButton(A1, BUTTON_PASSTHRU);
|
||||
|
||||
// Doors & Lights
|
||||
joystick.AddButton(A2, BUTTON_PASSTHRU);
|
||||
joystick.AddButton(A3, BUTTON_PASSTHRU);
|
||||
joystick.AddButton(0, BUTTON_PASSTHRU, true, mux);
|
||||
|
||||
// Flight Modes
|
||||
joystick.AddButton(1, BUTTON_PASSTHRU, true, mux);
|
||||
joystick.AddButton(2, BUTTON_PASSTHRU, true, mux);
|
||||
joystick.AddButton(3, BUTTON_PASSTHRU, true, mux);
|
||||
joystick.AddButton(4, BUTTON_PASSTHRU, true, mux);
|
||||
|
||||
// Emergency Panel
|
||||
joystick.AddButton(5, BUTTON_PASSTHRU, true, mux);
|
||||
joystick.AddButton(6, BUTTON_PASSTHRU, true, mux);
|
||||
joystick.AddButton(7, BUTTON_PASSTHRU, true, mux);
|
||||
|
||||
joystick.Init();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
joystick.Update();
|
||||
}
|
Loading…
Reference in New Issue
Block a user