-
Notifications
You must be signed in to change notification settings - Fork 23
Getting Started
MrBuzzKillington edited this page Oct 31, 2021
·
7 revisions
- Git tools TortioseGit
- Arduino IDE
- Digital Combat Simulator (DCS) - Steam or ED Stand-alone
- DCS-BIOS Lua files - Flight Panels Release
- DCS-BIOS Arduino library This repo
- Arduino UNO or MEGA
- Switches, LEDS, etc
- Wire
- Basic Arduino programming (or willingness to learn)
- Basic wiring
- Patience :)
- Make sure you have opened both DCS and Arduino tools to ensure library paths are generated
- Git checkout both the LUA and Arduino files into your "my documents"
- In windows explorer: right click -> GitClone
- Use these 2 URLS (from above links)
https://github.com/talbotmcinnis/dcs-bios-arduino-library.git
https://github.com/DCSFlightpanels/dcs-bios.git
- Configure DCS-BIO (follow tutorial on Flight Panels Wiki)
- Copy folder dcs-bios->scripts->DCS-BIOS into your saved games folder C:\Users\USERNAME\Saved Games\DCS\scripts\
- Copy Export.lua into C:\Users\USERNAME\Saved Games\DCS\scripts\
- Extract SOCAT
- Extract socat tools from dcs-bios->program->socat
- Verify connect serial port icon opens a socat terminal, double click dcs-bios/programs->connect-serial-port.cmd
- Install Arduino library (from git checkout)
- Copy folder dcs-bios-arduino-library to C:\Users__\Documents\Arduino\libraries
Note 1: There is a copy of this library in the dcs-bios repo but it may be out of date from latest
Note 2: Many DCS-BIOS status variables tie directly to memory addresses within the game. Your DCS, DCS-BIOS, and Arduino code need to stay in sync, if you update DCS expect to update DCS-BIOS lua and Arduino code.
- Open control-ref documents using web browser via
file:///C:/Users/USERNAME/Saved%20Games/DCS/scripts/DCS-BIOS/doc/control-reference.html - Open Arduino IDE
- Paste Default template
#define DCSBIOS_DEFAULT_SERIAL
#include "DcsBios.h"
/* paste code snippets from the reference documentation here */
void setup() {
DcsBios::setup();
}
void loop() {
DcsBios::loop();
}
- Compile and upload to board with => icon
Congratulations you made your first DCS-BIOS Arduino script, now lets make it do something useful and test it
Each aircraft has unique hardware settings, using the control-reference.html find the available commands
For this example we will use the F-16C Block 50 module by selecting F-16C_50 from the module drop-down
- Copy and past the example source code for the signal to be controlled into your project above void setup() where indicated
DcsBios::Switch2Pos seatEjectSafe("SEAT_EJECT_SAFE", PIN);
DcsBios::LED lightSeatNot(0x4472, 0x0400, PIN);
- Specify the PIN number tied to your switch or LED (Wiring Basics and Examples)
/*
Simple Example
*/
#define DCSBIOS_DEFAULT_SERIAL
#include "DcsBios.h"
DcsBios::Switch2Pos seatEjectSafe("SEAT_EJECT_SAFE", 53);
DcsBios::LED lightSeatNot(0x4472, 0x0400, LED_BUILTIN);
void setup() {
DcsBios::setup();
}
void loop() {
DcsBios::loop();
}
- Compile and upload to Arduino
- Start serial port forwarding
SOCAT converts the Arduino serial port interface to ethernet packets which the LUA mod listens for
- Run SOCAT program via shortcut (connect-serial-port.cmd)
- Enter serial port number for connected Arduino
- After the timeout expires, toggle the switch and verify SEAT_EJECT_SAFE commands are observed
- Start DCS -> Enter cockpit (instant action -> ready on ramp)
- Toggle seat arm switch and verify both in-game switch and Arduino LED operate
- You can repeat these steps for all available controls in DCS
Note 1: You do NOT need to close DCS in order to modify your Arduino design
Note 2: You DO need to close SOCAT in order to reprogram the Arduino