Jump to content

Need Help for F-16 Caution Panel (Matrix LED wired)


Recommended Posts

Posted (edited)

Hi ,

I want to do an F16 Caution Panel . I made an Matrix Led (max7219) wired like in this image (Breadboard with only 32 Led's)

image_116450.thumb.jpg.480312d6ecc1a2e919f7ff2f031902c1.jpg

All Led's are working (ignore the colors of the LED's)

20201128_172904-900x2000.thumb.jpg.0529e18426b339104ffe14e11025011f.jpg

Can someone look at this sketch and explain me the values in the char row map and mask map ... i don't understand this ..

because most of the Led's are not working or in the wrong way .

I am really new to this and an absolute Beginner .

Thanks 🙂

 

 

//#define DCSBIOS_IRQ_SERIAL
#define DCSBIOS_DEFAULT_SERIAL
#include <DcsBios.h>
#include <LedControl.h>

LedControl lc = LedControl(12, 11, 10, 1); //DIN,CLK,LOAD,# OF IC's

unsigned char cl_row_map[32] = {
0, 2, 4, 6,
0, 2, 4, 6,
0, 2, 4, 6,
0, 2, 4, 6,
0, 2, 4, 6,
0, 2, 4, 6,
1, 3, 5, 7,
1, 3, 5, 7,

};
#define SEG_DP (1<<7)
#define SEG_A (1<<6)
#define SEG_B (1<<5)
#define SEG_C (1<<4)
#define SEG_D (1<<3)
#define SEG_E (1<<2)
#define SEG_F (1<<1)
#define SEG_G (1<<0)

unsigned char cl_mask_map[32] = {
SEG_DP, SEG_B, SEG_D, SEG_F,
SEG_DP, SEG_B, SEG_D, SEG_F,
SEG_DP, SEG_B, SEG_D, SEG_F,
SEG_DP, SEG_B, SEG_D, SEG_F,
SEG_DP, SEG_B, SEG_D, SEG_F,
SEG_DP, SEG_B, SEG_D, SEG_F,
SEG_A, SEG_C, SEG_E, SEG_G,
SEG_A, SEG_C, SEG_E, SEG_G,
};


unsigned char max7219_rows[8];

void setup() {
DcsBios::setup();
memset(max7219_rows, 0xff, sizeof(max7219_rows)); // all led's on

lc.shutdown(0, false); //turn on the display
lc.setIntensity(0, 1); //set the brightness
lc.clearDisplay(0); //clear rthe display and get ready for new data
}

void updateCautionLights(unsigned int address, unsigned int data) {
unsigned char clp_row = (address - 0x446e) * 2;
unsigned char start_index = clp_row * 4;
unsigned char column = 0;
unsigned char i;

bool is_on;
for (i = 0; i < 16; i++) {
is_on = data & 0x01;
// set caution light state (clp_row, column, is_on)
if (is_on) {
max7219_rows[cl_row_map[start_index + i]] |= cl_mask_map[start_index + i];
} else {
max7219_rows[cl_row_map[start_index + i]] &= ~(cl_mask_map[start_index + i]);
}
data >>= 1;
column++;
if (column == 4) {
clp_row++;
column = 0;
}
}

}

void onClpData1Change(unsigned int newValue) {
updateCautionLights(0x446e, newValue);
}
DcsBios::IntegerBuffer clpData1(0x446e, 0xffff, 0, onClpData1Change);

void onClpData2Change(unsigned int newValue) {
updateCautionLights(0x4470, newValue);
}
DcsBios::IntegerBuffer clpData2(0x4470, 0xffff, 0, onClpData2Change);

void onClpData3Change(unsigned int newValue) {
updateCautionLights(0x4472, newValue);
}
DcsBios::IntegerBuffer clpData3(0x4472, 0xffff, 0, onClpData3Change);

void loop() {
DcsBios::loop();

// update MAX7219
unsigned char i;
for (i = 0; i < 8; i++) {
lc.setRow(0, i, max7219_rows[i]);
}
}
 
Edited by JohnnyChicago
more unterstandable
Posted

Any chance you could post a screenshot of your Arduino IDE page. This is a bit difficult to read.

 

Did you write this or are you trying to make another sketch work?

 

 

Sent from my iPad using Tapatalk

Posted
Hi , what is difficult to read ?

 

Your code post is a run on sentence.

 

There is some code in your post I see and recognize from a prior thread on the A-10 caution panel.

 

So the second question remains is this your actual code or something you are trying to use.

 

I used a 7219 for my panel lights.

 

Happy to help if your want

 

 

Sent from my iPad using Tapatalk

Posted

 

It looks perfectly fine (and in a code window) to me.

 

37a93ea2fb83eb434e273fbd9aadd6d8.jpg

Found the thread on Tapatalk.

Can't stand the new forum. Will have to see what new is coming.

 

Will send a copy of my working sketch via pm Monday.

I have only worked with the F-18 DCSBios exports and The A-10 is the one I have seen that exports the caution panel in banks of data. The F-18 uses individually addressable light locations and they are lit by using the 7219 matrix x/y positions for up to 64 possible lights. You can run a pair off LEDs off each location in the matrix.

 

 

Sent from my iPad using Tapatalk

  • JohnnyChicago changed the title to Need Help for F-16 Caution Panel (Matrix LED wired)
  • 1 year later...
  • 6 months later...
Posted (edited)

With the help from the code for the F/A-18 by Fusedspine33I 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();

}

 

8x8LEDmatrix.jpg

8x8-dot-matrix-module-cascadable-max7219-19379-66-B.jpg

8X8-Matrix-Pinout.png

8x8ledmatrix2.jpg

Edited by Doc78
Correcting errors
  • Like 2
  • Thanks 1
  • 1 year later...
Posted (edited)

@Doc78 @Fusedspine33

Thank you so much for sharing your code! I had been trying to make it work on my end but I was unsuccessful until today. I realised that the address of the LED values in DCS bios are different than the ones written by you guys (with DCS HUB) so the code wasn't working.

I think DCS HUB is obsolete now, so if anyone wants to make the code working with the latest DCS bios version (I have currently v0.8.3) here's the new version

Simply upload the code to your arduino Nano, connect pins 10, 11, 12 to LOAD/CS, CLK, DATA IN on the MAX7219 board, VCC to 5v and GND to GND and enjoy:

Spoiler

// DCS F16 Caution panel LED Matrix by Fusedspine33 edited by The Viper Project //

 

/* 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

 */  

 

#include <LedControl.h>

#include <Arduino.h>

#include <SPI.h>

 

#define DCSBIOS_DEFAULT_SERIAL

#include <DcsBios.h>

 

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(0x4476, 0x0001, 0, onLightFlcsFaultChange);


 

void onLightElecSysChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 1, 0, newValue);

    lc1.setLed(0, 1, 1, newValue);

}

DcsBios::IntegerBuffer lightElecSysBuffer(0x4476, 0x0010, 4, onLightElecSysChange);


 

void onLightProbeHeatChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 2, 0, newValue);

    lc1.setLed(0, 2, 1, newValue);

}

DcsBios::IntegerBuffer lightProbeHeatBuffer(0x4476, 0x0100, 8, onLightProbeHeatChange);


 

void onLightCadcChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 3, 0, newValue);

    lc1.setLed(0, 3, 1, newValue);

}

DcsBios::IntegerBuffer lightCadcBuffer(0x4476, 0x1000, 12, onLightCadcChange);


 

void onLightStoresConfigChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 4, 0, newValue);

    lc1.setLed(0, 4, 1, newValue);

}

DcsBios::IntegerBuffer lightStoresConfigBuffer(0x4478, 0x0001, 0, onLightStoresConfigChange);


 

void onLightAtfNotChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 5, 0, newValue);

    lc1.setLed(0, 5, 1, newValue);

}

DcsBios::IntegerBuffer lightAtfNotBuffer(0x4478, 0x0010, 4, onLightAtfNotChange);


 

void onLightFwdFuelLowChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 6, 0, newValue);

    lc1.setLed(0, 6, 1, newValue);

}

DcsBios::IntegerBuffer lightFwdFuelLowBuffer(0x4478, 0x0100, 8, onLightFwdFuelLowChange);


 

void onLightAftFuelLowChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 7, 0, newValue);

    lc1.setLed(0, 7, 1, newValue);

}

DcsBios::IntegerBuffer lightAftFuelLowBuffer(0x4478, 0x1000, 12, 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(0x4476, 0x0002, 1, onLightEngineFaultChange);


 

void onLightSecChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 1, 2, newValue);

    lc1.setLed(0, 1, 3, newValue);

}

DcsBios::IntegerBuffer lightSecBuffer(0x4476, 0x0020, 5, onLightSecChange);


 

void onLightFuelOilHotChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 2, 2, newValue);

    lc1.setLed(0, 2, 3, newValue);

}

DcsBios::IntegerBuffer lightFuelOilHotBuffer(0x4476, 0x0200, 9, onLightFuelOilHotChange);


 

void onLightInletIcingChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 3, 2, newValue);

    lc1.setLed(0, 3, 3, newValue);

}

DcsBios::IntegerBuffer lightInletIcingBuffer(0x4476, 0x2000, 13, onLightInletIcingChange);


 

void onLightOverheatChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 4, 2, newValue);

    lc1.setLed(0, 4, 3, newValue);

}

DcsBios::IntegerBuffer lightOverheatBuffer(0x4478, 0x0002, 1, onLightOverheatChange);


 

void onLightEecChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 5, 2, newValue);

    lc1.setLed(0, 5, 3, newValue);

}

DcsBios::IntegerBuffer lightEecBuffer(0x4478, 0x0020, 5, onLightEecChange);


 

void onLightBucChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 6, 2, newValue);

    lc1.setLed(0, 6, 3, newValue);

}

DcsBios::IntegerBuffer lightBucBuffer(0x4478, 0x0200, 9, onLightBucChange);


 

void onLightCaution1Change(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 7, 2, newValue);

    lc1.setLed(0, 7, 3, newValue);

}

DcsBios::IntegerBuffer lightCaution1Buffer(0x4478, 0x0040, 6, 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(0x4476, 0x0004, 2, onLightAvionicsFaultChange);


 

void onLightEquipHotChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 1, 4, newValue);

    lc1.setLed(0, 1, 5, newValue);

}

DcsBios::IntegerBuffer lightEquipHotBuffer(0x4476, 0x0040, 6, onLightEquipHotChange);


 

void onLightRadarAltChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 2, 4, newValue);

    lc1.setLed(0, 2, 5, newValue);

}

DcsBios::IntegerBuffer lightRadarAltBuffer(0x4476, 0x0400, 10, onLightRadarAltChange);


 

void onLightIffChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 3, 4, newValue);

    lc1.setLed(0, 3, 5, newValue);

}

DcsBios::IntegerBuffer lightIffBuffer(0x4476, 0x4000, 14, onLightIffChange);


 

void onLightNuclearChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 4, 4, newValue);

    lc1.setLed(0, 4, 5, newValue);

}

DcsBios::IntegerBuffer lightNuclearBuffer(0x4478, 0x0004, 2, onLightNuclearChange);


 

void onLightCaution2Change(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 5, 4, newValue);

    lc1.setLed(0, 5, 5, newValue);

}

DcsBios::IntegerBuffer lightCaution2Buffer(0x4478, 0x0400, 10, onLightCaution2Change);


 

void onLightCaution3Change(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 6, 4, newValue);

    lc1.setLed(0, 6, 5, newValue);

}

DcsBios::IntegerBuffer lightCaution3Buffer(0x4478, 0x0800, 11, onLightCaution3Change);


 

void onLightCaution4Change(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 7, 4, newValue);

    lc1.setLed(0, 7, 5, newValue);

}

DcsBios::IntegerBuffer lightCaution4Buffer(0x4478, 0x2000, 13, 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(0x4476, 0x0008, 3, onLightSeatNotChange);


 

void onLightNwsFailChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 1, 6, newValue);

    lc1.setLed(0, 1, 7, newValue);

}

DcsBios::IntegerBuffer lightNwsFailBuffer(0x4476, 0x0080, 7, onLightNwsFailChange);

 

   

void onLightAntiSkidChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 2, 6, newValue);

    lc1.setLed(0, 2, 7, newValue);

}

DcsBios::IntegerBuffer lightAntiSkidBuffer(0x4476, 0x0800, 11, onLightAntiSkidChange);


 

void onLightHookChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 3, 6, newValue);

    lc1.setLed(0, 3, 7, newValue);

}

DcsBios::IntegerBuffer lightHookBuffer(0x4476, 0x8000, 15, onLightHookChange);


 

void onLightObogsChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 4, 6, newValue);

    lc1.setLed(0, 4, 7, newValue);

}

DcsBios::IntegerBuffer lightObogsBuffer(0x4478, 0x0008, 3, onLightObogsChange);


 

void onLightCabinPressChange(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 5, 6, newValue);

    lc1.setLed(0, 5, 7, newValue);

}

DcsBios::IntegerBuffer lightCabinPressBuffer(0x4478, 0x0080, 7, onLightCabinPressChange);


 

void onLightCaution5Change(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 6, 6, newValue);

    lc1.setLed(0, 6, 7, newValue);

}

DcsBios::IntegerBuffer lightCaution5Buffer(0x4478, 0x4000, 14, onLightCaution5Change);


 

void onLightCaution6Change(unsigned int newValue) {

    bool intToBool(newValue);

    lc1.setLed(0, 7, 6, newValue);

    lc1.setLed(0, 7, 7, newValue);

}

DcsBios::IntegerBuffer lightCaution6Buffer(0x4478, 0x8000, 15, onLightCaution6Change);


 

void loop() {

 

DcsBios::loop();

 

}

 

Edited by Snakedoc
Typo
  • Thanks 1

ASUS ROG STRIX Z490 F-GAMING | i7-10700K | RTX3090 TUF OC | 32GB DDR4 3200Mhz | Windows 10 64bit | Acer Predator X34P | TrackIR 5 | TM Warthog | TM T.Flight Rudder Pedals

A-10C | A-10C II | F/A-18C | F-16C | FC3 | PG | Syria | SC

Home made F-16C simulator
Forum Thread: DCS World forum - The Viper Project - Home Cockpits Instagram: 1583142 copia.jpg The Viper Project YouTube youtube-icon-512x512-874lspju.png The Viper Project - Youtube channel

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...