Jump to content

Doc78

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by Doc78

  1. With the help from the code for the F/A-18 by Fusedspine33, I have managed to get it to work for the F16. I have experimented with a 8x8 matrix led board, driven by an Arduino Nano. Because this has a 8x8 matrix and the CautionPanel has a 4x8 matrix, I have edited the code. For one indicator, 2 leds are used. With just a 8x8 matrix pcb you can connect you own led matrix panel to the pcb. I am using DCS HUB. #include <LedControl.h> #include <Arduino.h> #include <SPI.h> #define DCSBIOS_DEFAULT_SERIAL #include <DcsBios.h> /* Create a new LedControl variable. * We use pins 12,11 and 10 on the Arduino for the SPI interface * Pin 12 is connected to the DATA IN-pin of the first MAX7219 * Pin 11 is connected to the CLK-pin of the first MAX7219 * Pin 10 is connected to the LOAD(/CS)-pin of the first MAX7219 * There will only be a single MAX7219 attached to the arduino */ LedControl lc1=LedControl(12,11,10,1); void setup() { // set up dcs-bios: DcsBios::setup(); // put your setup code here, to run once: // wake up the MAX72XX from power-saving mode lc1.shutdown(0,false); // set a medium brightness for the Leds lc1.setIntensity(0,12); // clear the display lc1.clearDisplay(0); } // Column 1 void onLightFlcsFaultChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 0, 0, newValue); lc1.setLed(0, 0, 1, newValue); } DcsBios::IntegerBuffer lightFlcsFaultBuffer(0x4472, 0x0080, 7, onLightFlcsFaultChange); void onLightElecSysChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 1, 0, newValue); lc1.setLed(0, 1, 1, newValue); } DcsBios::IntegerBuffer lightElecSysBuffer(0x4472, 0x0800, 11, onLightElecSysChange); void onLightProbeHeatChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 2, 0, newValue); lc1.setLed(0, 2, 1, newValue); } DcsBios::IntegerBuffer lightProbeHeatBuffer(0x4472, 0x8000, 15, onLightProbeHeatChange); void onLightCadcChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 3, 0, newValue); lc1.setLed(0, 3, 1, newValue); } DcsBios::IntegerBuffer lightCadcBuffer(0x4474, 0x0008, 3, onLightCadcChange); void onLightStoresConfigChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 4, 0, newValue); lc1.setLed(0, 4, 1, newValue); } DcsBios::IntegerBuffer lightStoresConfigBuffer(0x4474, 0x0080, 7, onLightStoresConfigChange); void onLightAtfNotChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 5, 0, newValue); lc1.setLed(0, 5, 1, newValue); } DcsBios::IntegerBuffer lightAtfNotBuffer(0x4474, 0x0800, 11, onLightAtfNotChange); void onLightFwdFuelLowChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 6, 0, newValue); lc1.setLed(0, 6, 1, newValue); } DcsBios::IntegerBuffer lightFwdFuelLowBuffer(0x4474, 0x8000, 15, onLightFwdFuelLowChange); void onLightAftFuelLowChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 7, 0, newValue); lc1.setLed(0, 7, 1, newValue); } DcsBios::IntegerBuffer lightAftFuelLowBuffer(0x4476, 0x0008, 3, onLightAftFuelLowChange); // Column 2 void onLightEngineFaultChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 0, 2, newValue); lc1.setLed(0, 0, 3, newValue); } DcsBios::IntegerBuffer lightEngineFaultBuffer(0x4472, 0x0100, 8, onLightEngineFaultChange); void onLightSecChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 1, 2, newValue); lc1.setLed(0, 1, 3, newValue); } DcsBios::IntegerBuffer lightSecBuffer(0x4472, 0x1000, 12, onLightSecChange); void onLightFuelOilHotChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 2, 2, newValue); lc1.setLed(0, 2, 3, newValue); } DcsBios::IntegerBuffer lightFuelOilHotBuffer(0x4474, 0x0001, 0, onLightFuelOilHotChange); void onLightInletIcingChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 3, 2, newValue); lc1.setLed(0, 3, 3, newValue); } DcsBios::IntegerBuffer lightInletIcingBuffer(0x4474, 0x0010, 4, onLightInletIcingChange); void onLightOverheatChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 4, 2, newValue); lc1.setLed(0, 4, 3, newValue); } DcsBios::IntegerBuffer lightOverheatBuffer(0x4474, 0x0100, 8, onLightOverheatChange); void onLightEecChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 5, 2, newValue); lc1.setLed(0, 5, 3, newValue); } DcsBios::IntegerBuffer lightEecBuffer(0x4474, 0x1000, 12, onLightEecChange); void onLightBucChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 6, 2, newValue); lc1.setLed(0, 6, 3, newValue); } DcsBios::IntegerBuffer lightBucBuffer(0x4476, 0x0001, 0, onLightBucChange); void onLightCaution1Change(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 7, 2, newValue); lc1.setLed(0, 7, 3, newValue); } DcsBios::IntegerBuffer lightCaution1Buffer(0x4474, 0x2000, 13, onLightCaution1Change); // Column 3 void onLightAvionicsFaultChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 0, 4, newValue); lc1.setLed(0, 0, 5, newValue); } DcsBios::IntegerBuffer lightAvionicsFaultBuffer(0x4472, 0x0200, 9, onLightAvionicsFaultChange); void onLightEquipHotChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 1, 4, newValue); lc1.setLed(0, 1, 5, newValue); } DcsBios::IntegerBuffer lightEquipHotBuffer(0x4472, 0x2000, 13, onLightEquipHotChange); void onLightRadarAltChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 2, 4, newValue); lc1.setLed(0, 2, 5, newValue); } DcsBios::IntegerBuffer lightRadarAltBuffer(0x4474, 0x0002, 1, onLightRadarAltChange); void onLightIffChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 3, 4, newValue); lc1.setLed(0, 3, 5, newValue); } DcsBios::IntegerBuffer lightIffBuffer(0x4474, 0x0020, 5, onLightIffChange); void onLightNuclearChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 4, 4, newValue); lc1.setLed(0, 4, 5, newValue); } DcsBios::IntegerBuffer lightNuclearBuffer(0x4474, 0x0200, 9, onLightNuclearChange); void onLightCaution2Change(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 5, 4, newValue); lc1.setLed(0, 5, 5, newValue); } DcsBios::IntegerBuffer lightCaution2Buffer(0x4476, 0x0002, 1, onLightCaution2Change); void onLightCaution3Change(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 6, 4, newValue); lc1.setLed(0, 6, 5, newValue); } DcsBios::IntegerBuffer lightCaution3Buffer(0x4476, 0x0004, 2, onLightCaution3Change); void onLightCaution4Change(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 7, 4, newValue); lc1.setLed(0, 7, 5, newValue); } DcsBios::IntegerBuffer lightCaution4Buffer(0x4476, 0x0010, 4, onLightCaution4Change); // Column 4 void onLightSeatNotChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 0, 6, newValue); lc1.setLed(0, 0, 7, newValue); } DcsBios::IntegerBuffer lightSeatNotBuffer(0x4472, 0x0400, 10, onLightSeatNotChange); void onLightNwsFailChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 1, 6, newValue); lc1.setLed(0, 1, 7, newValue); } DcsBios::IntegerBuffer lightNwsFailBuffer(0x4472, 0x4000, 14, onLightNwsFailChange); void onLightAntiSkidChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 2, 6, newValue); lc1.setLed(0, 2, 7, newValue); } DcsBios::IntegerBuffer lightAntiSkidBuffer(0x4474, 0x0004, 2, onLightAntiSkidChange); void onLightHookChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 3, 6, newValue); lc1.setLed(0, 3, 7, newValue); } DcsBios::IntegerBuffer lightHookBuffer(0x4474, 0x0040, 6, onLightHookChange); void onLightObogsChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 4, 6, newValue); lc1.setLed(0, 4, 7, newValue); } DcsBios::IntegerBuffer lightObogsBuffer(0x4474, 0x0400, 10, onLightObogsChange); void onLightCabinPressChange(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 5, 6, newValue); lc1.setLed(0, 5, 7, newValue); } DcsBios::IntegerBuffer lightCabinPressBuffer(0x4474, 0x4000, 14, onLightCabinPressChange); void onLightCaution5Change(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 6, 6, newValue); lc1.setLed(0, 6, 7, newValue); } DcsBios::IntegerBuffer lightCaution5Buffer(0x4476, 0x0020, 5, onLightCaution5Change); void onLightCaution6Change(unsigned int newValue) { bool intToBool(newValue); lc1.setLed(0, 7, 6, newValue); lc1.setLed(0, 7, 7, newValue); } DcsBios::IntegerBuffer lightCaution6Buffer(0x4476, 0x0040, 6, onLightCaution6Change); void loop() { // put your main code here, to run repeatedly: DcsBios::loop(); }
  2. I`m using DCS-BIOS Hub, latest version.
  3. I've tried it, but unfortunately no joy. But with this code, the led went on when I selected GD1 on the AUDIO1 panel...
  4. I can`t find the code for the ECM light on the F16 MISC-panel in DCS-BIOS. I this not implemented yet?
  5. Does anyone have it working?
  6. I use F4toserial for the DED in BMS.
  7. It works. Changing the code from U8G2_R0 to U8G2_2 did the trick. U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R2, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); I use a different (Chinese, FeiYang) display than the display from Buydisplay.com.
  8. First of all, thanks to you guys who made this possilble!! I had the same problem with the missing text on the left side. This new code did work. The complete text on the DED is visible, but now it is flipped upside down. Probably an easy way to correct this, but i have no clue.
  9. I've tested this code with a 3.12 inch OLED on a Arduino Mega and on a Arduino Nano. Both do work, but in both cases the full text is only using halve the screen. Is there a solution for this situation? Ps. I have no nowledge of coding in Arduino IDE. I'm more a copy/paste kind of person...
×
×
  • Create New...