#include Centipede CS; // create Centipede Object #include #include #include // order of these includes seems no matter - tried different /**** Make your changes after this line ****/ #include "BIOS_calls.h" // here includes (to pull error-relevant code not too far) copy-and-pastes from the DCS-BIOS/doc/control-reference.html /**** In most cases, you do not have to change anything below this line ****/ /* this is a fragment of my last attempt (just to remember of pin numbers (will be deleted if debugged) int a_1 = 4; // erster digitaler Input Arduino - 2 und 3 durch I2C besetzt int a_n = 9; // letzter digitaler Pin Arduino (ab 10 für Beleuchtung) int c_1 = 0; // erster digitaler Input Centipede int c_n = 63; // letzter digitaler Pin Centipede (alle 64 nutzbar) int dim = 5; // Helligkeit LEDs bei Start int dim_out = 10; // PWM Ausgang (nur 3 5 6 9 10 / defekt:11 */ DcsBios::ProtocolParser parser; // Instantiate a ProtocolParser object to parse the DCS-BIOS export stream void setup() { Wire.begin(); // start I2C CS.initialize(); // set all registers to default Serial.begin(500000); } /* Your main loop needs to pass data from the DCS-BIOS export stream to the parser object you instantiated above. It also needs to call DcsBios::PollingInput::pollInputs() to detect changes in the state of connected controls and pass them on to DCS. */ void loop() { // feed incoming data to the parser while (Serial.available()) { parser.processChar(Serial.read()); } // poll inputs DcsBios::PollingInput::pollInputs(); } /* You need to define void sendDcsBiosMessage(const char* msg, const char* arg) so that the string msg, followed by a space, the string arg and a newline gets sent to the DCS-BIOS import stream. In this example, we will send the data to the I2C bus, where another Arduino that is running the I2CSerialBridgeTemplateSketch will pick it up and forward it to the DCS computer. */ void sendDcsBiosMessage(const char* msg, const char* arg) { Wire.beginTransmission(8); Wire.write(msg); Wire.write(' '); Wire.write(arg); Wire.write('\n'); Wire.endTransmission(); //----------*/ Serial.write(msg); Serial.write(' '); Serial.write(arg); Serial.write('\n'); //---------- } /* This subroutine gets called every time a message is received from the export stream (you need to define it even if it does nothing). Use this to handle outputs which are not covered by the DcsBios Arduino library (e.g. displays). */ void onDcsBiosWrite(unsigned int address, unsigned int value) { }