Jump to content

Recommended Posts

Posted

Hi guys ,

 

did someone can help me ?

 

i build one sketch for my lights ( flaps , weapons lights , airbrakes ... ) and another one for my radio FQ display .

 

Can you rewrite for me one sketch from these 2 ? melt them ?

 

regards

 

Guillaume :

 

FIRST ONE :

 

/* use '#define DCSBIOS_DEFAULT_SERIAL' instead if your Arduino board

* does not feature an ATMega328 or ATMega2650 controller.

*/

#define DCSBIOS_IRQ_SERIAL

#include "DcsBios.h"

 

DcsBios::LED pltHookLight(0x12ee, 0x0008, 2);

DcsBios::LED pltSwCoolOn(0x12e2, 0x4000, 13);

DcsBios::LED pltMslPrepOn(0x12e4, 0x0001, 12);

DcsBios::LED pltGunRateHigh(0x12e2, 0x1000, 10);

DcsBios::LED pltMasterCaution(0x12e2, 0x0100, 11);

DcsBios::LED pltMslModeBore(0x12e4, 0x0008, 7);

DcsBios::LED pltSeamLock(0x12e2, 0x0800, 5);

DcsBios::LED pltFlapsInd(0x13c0, 0x0fff, 2);

DcsBios::LED pltSpdbrkFull(0x13ba, 0x0fff, 3);

DcsBios::LED pltSlatsInd(0x13be, 0x0fff, A7);

DcsBios::RotaryEncoder pltHsdKnobCrs("PLT_HSD_KNOB_CRS", "-1200", "+1200", 53, 51);

DcsBios::Potentiometer pltEmergWingSweepltLever("PLT_EMERG_WING_SWEEPLT_LEVER", A0, false, 0, 385);

DcsBios::Potentiometer pltVuhfVol("PLT_VUHF_VOL", A4);

DcsBios::Potentiometer pltUhf1Vol("PLT_UHF1_VOL", A5);

 

void setup() {

DcsBios::setup();

}

 

void loop() {

DcsBios::loop();

}

 

 

 

 

SECOND ONE :

 

Tell DCS-BIOS to use a serial connection and use interrupt-driven

communication. The main program will be interrupted to prioritize

processing incoming data.

 

This should work on any Arduino that has an ATMega328 controller

(Uno, Pro Mini, many others).

*/

#define DCSBIOS_IRQ_SERIAL

 

#include "DcsBios.h"

#include <LedControl.h>

/* pin 7 is connected to the DataIn

pin 6 is connected to the CLK

pin 5 is connected to LOAD

We have only a single MAX72XX.

*/

LedControl lc=LedControl(22,26,24,1);

 

/* paste code snippets from the reference documentation here */

//PILOT ARC-159 Frequency

void onPltUhfStringFreqChange(char* newValue) {

lc.setChar(0,0,newValue[6],false);

lc.setChar(0,1,newValue[5],false);

lc.setChar(0,2,newValue[4],false); //true=this is the full stop after digit no 3

lc.setChar(0,3,newValue[2],true);

lc.setChar(0,4,newValue[1],false);

lc.setChar(0,5,newValue[0],false);

}

DcsBios::StringBuffer<7> pltUhfStringFreqBuffer(0x1248, onPltUhfStringFreqChange);

 

 

void setup() {

DcsBios::setup();

//This initializes the MAX7219 and gets it ready of use:

lc.shutdown(0,false); //turn on the display

lc.setIntensity(0,10);//set the brightness

lc.clearDisplay(0); //clear the display

 

//The following series of "lc.setChar" commands are used to display the number 8 in each digit. This allows us to see each that LED segment is actually working.

lc.setChar(0,0,'8',false);// The first number...0, means there are no other MAX7219's connected to the one we are using.

lc.setChar(0,1,'8',false);// The second number...1, indicates the digit you are sending data too...digit numbering starts at 0.

lc.setChar(0,2,'8',false);// The third number in single quotes is the character thats displayed

lc.setChar(0,3,'8',false);// The statement... true/false is to turn on or off the decimal point (dp) for that particular digit.

lc.setChar(0,4,'8',false);

lc.setChar(0,5,'8',false);

}

 

void loop() {

DcsBios::loop();

}

Posted

How about that?

It compiles on Arduino but there seems trouble with the line 38, so it`s temporary deactivated

 

DcsBios::Potentiometer pltEmergWingSweepltLever("PLT_EMERG_WING_SWEEPLT_LEVER", A0, false, 0, 385);

/* use '#define DCSBIOS_DEFAULT_SERIAL' instead if your Arduino board
* does not feature an ATMega328 or ATMega2650 controller.
*/
#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"

#include <LedControl.h>
/* pin 7 is connected to the DataIn
pin 6 is connected to the CLK
pin 5 is connected to LOAD
We have only a single MAX72XX.
*/
LedControl lc=LedControl(22,26,24,1);

/* paste code snippets from the reference documentation here */
//PILOT ARC-159 Frequency
void onPltUhfStringFreqChange(char* newValue) {
lc.setChar(0,0,newValue[6],false);
lc.setChar(0,1,newValue[5],false);
lc.setChar(0,2,newValue[4],false); //true=this is the full stop after digit no 3
lc.setChar(0,3,newValue[2],true);
lc.setChar(0,4,newValue[1],false);
lc.setChar(0,5,newValue[0],false);
}
DcsBios::StringBuffer<7> pltUhfStringFreqBuffer(0x1248, onPltUhfStringFreqChange);

DcsBios::LED pltHookLight(0x12ee, 0x0008, 2);
DcsBios::LED pltSwCoolOn(0x12e2, 0x4000, 13);
DcsBios::LED pltMslPrepOn(0x12e4, 0x0001, 12);
DcsBios::LED pltGunRateHigh(0x12e2, 0x1000, 10);
DcsBios::LED pltMasterCaution(0x12e2, 0x0100, 11);
DcsBios::LED pltMslModeBore(0x12e4, 0x0008, 7);
DcsBios::LED pltSeamLock(0x12e2, 0x0800, 5);
DcsBios::LED pltFlapsInd(0x13c0, 0x0fff, 2);
DcsBios::LED pltSpdbrkFull(0x13ba, 0x0fff, 3);
DcsBios::LED pltSlatsInd(0x13be, 0x0fff, A7);
DcsBios::RotaryEncoder pltHsdKnobCrs("PLT_HSD_KNOB_CRS", "-1200", "+1200", 53, 51);
// DcsBios::Potentiometer pltEmergWingSweepltLever("PLT_EMERG_WING_SWEEPLT_LEVER", A0, false, 0, 385);
DcsBios::Potentiometer pltVuhfVol("PLT_VUHF_VOL", A4);
DcsBios::Potentiometer pltUhf1Vol("PLT_UHF1_VOL", A5);

void setup() {
DcsBios::setup();
//This initializes the MAX7219 and gets it ready of use:
lc.shutdown(0,false); //turn on the display
lc.setIntensity(0,10);//set the brightness
lc.clearDisplay(0); //clear the display

//The following series of "lc.setChar" commands are used to display the number 8 in each digit. This allows us to see each that LED segment is actually working.
lc.setChar(0,0,'8',false);// The first number...0, means there are no other MAX7219's connected to the one we are using.
lc.setChar(0,1,'8',false);// The second number...1, indicates the digit you are sending data too...digit numbering starts at 0.
lc.setChar(0,2,'8',false);// The third number in single quotes is the character thats displayed
lc.setChar(0,3,'8',false);// The statement... true/false is to turn on or off the decimal point (dp) for that particular digit.
lc.setChar(0,4,'8',false);
lc.setChar(0,5,'8',false);
}

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

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

thx a lot vic , i will try it and i'll try to understand the logic

when you says it compiles on arduino , did you means it did it automaticcaly or you did it yourself ?

Posted

It compiles with the Arduino GUI without uploading the sketch to the chip.

As I don't have the hardware, I could at least check correct spelling.

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

  • Recently Browsing   0 members

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