Jump to content

Recommended Posts

Posted

All, using the data in the DCS BIOS below, I cannot get the gauges to function either in game or using Bobobear's testing debug program

void onOxyVolumeChange(unsigned int newValue) {
    /* your code here */
}
DcsBios::IntegerBuffer oxyVolumeBuffer(0x1132, 0xffff, 0, onOxyVolumeChange);

void onCabinPressAltChange(unsigned int newValue) {
    /* your code here */
}
DcsBios::IntegerBuffer cabinPressAltBuffer(0x1134, 0xffff, 0, onCabinPressAltChange);

I have tested the gauges using RENG fuel flow to make sure that they work and are correctly wired and pins called out, so it seems to be that these callouts are not functioning

Have they been updated or changed?

Cheers

Les

  • 2 weeks later...
Posted

All, I redid the sketch from scratch today, starting with a blank sketch and copying across code from working sketches and then splicing in the relevant DSC Bios lines. It works, so all I can surmise is that there is something corrupted in the original sketch.

I had a similar issue with an altimeter sketch a few days ago, where it just stopped working. Luckily the code was copied in notepad++ so I used that as a backup. However no matter how hard I looked I couldn't see what the difference between the two sketches were. It also reminded me of when RS485 stopped working, and it turned out it was a glitch with the Arduino IDE

So, a couple  of lessons learnt, 1) back up any working sketches, and 2) just because you can't see anything wrong with the sketch doesn't mean that you shouldn't  suspect it!

Hope this helps someone 

Les

  • Like 2
Posted

Yet another one today

 

Take a look at these two sketches for the glare-shield lights and switches. The first one give a bunch of errors during compiling, and the second works just fine. Can anyone see what the difference is?

Non-working sketch

#define DCSBIOS_IRQ_SERIAL

//#define DCSBIOS_RS485_SLAVE 61
//#define TXENABLE_PIN 2

#include "DcsBios.h"
#include <Arduino.h>

DcsBios::LED apuFire(0x10da, 0x0010, 13);
DcsBios::Switch2Pos extStoresJettison("EXT_STORES_JETTISON", 11);
DcsBios::Switch2Pos fireApuPull("FIRE_APU_PULL", 14);
DcsBios::Switch3Pos fireExtDisch("FIRE_EXT_DISCH", 19, 18);
DcsBios::Switch2Pos fireLengPull("FIRE_LENG_PULL", 17);
DcsBios::Switch2Pos fireRengPull("FIRE_RENG_PULL", 15);
DcsBios::LED lEngFire(0x10da, 0x0008, 16);
DcsBios::LED rEngFire(0x10da, 0x0020, 12);
DcsBios::LED canopyUnlocked(0x10da, 0x0004, 3);
DcsBios::LED gunReady(0x1026, 0x8000, 10);
DcsBios::LED markerBeacon(0x10da, 0x0002, 4);
DcsBios::LED nosewheelSteering(0x10da, 0x0001, 9);


void setup(void) {

  DcsBios::setup();

}

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

and the working sketch

#define DCSBIOS_IRQ_SERIAL

//#define DCSBIOS_RS485_SLAVE 61
//#define TXENABLE_PIN 2

#include "DcsBios.h"
#include <Arduino.h>

DcsBios::LED apuFire(0x10da, 0x0010, 13);
DcsBios::Switch2Pos extStoresJettison("EXT_STORES_JETTISON", 11);
DcsBios::Switch2Pos fireApuPull("FIRE_APU_PULL", 14);
DcsBios::Switch3Pos fireExtDisch("FIRE_EXT_DISCH", 19, 18);
DcsBios::Switch2Pos fireLengPull("FIRE_LENG_PULL", 17);
DcsBios::Switch2Pos fireRengPull("FIRE_RENG_PULL", 15);
DcsBios::LED lEngFire(0x10da, 0x0008, 16);
DcsBios::LED rEngFire(0x10da, 0x0020, 12);
DcsBios::LED canopyUnlocked(0x10da, 0x0004, 3);
DcsBios::LED gunReady(0x1026, 0x8000, 10);
DcsBios::LED markerBeacon(0x10da, 0x0002, 4);
DcsBios::LED nosewheelSteering(0x10da, 0x0001, 9);


void setup(void) {
  
  DcsBios::setup();

}

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

There must be something in there that is different, and if someone could point it out I would be grateful

Cheers

Les

Posted (edited)

Hi Les,

 

both files compile without error.

Using ->WinMerge<- I've found the only difference is two SPACE characters in line 24, not visible to the naked eye within the second file. That's the blank line after "void setup". That makes no difference to the compilation. It must be an other problem in your setup.

 

Regards, Vinc

compare.jpg

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

I re-installed the Arduino IDE and now it compiles fine; I have done registry scans and virus scans etc to check but nothing comes up as being screwy. Looks like I will have to keep an eye on that, maybe do a pre-emptive periodic reinstall to make sure that it doesn't have issues.

However before re-installing the IDE I tried copying the sketch to a USB stick and opening it on another laptop and a message came up saying that the sketch was not able to open.

Strange

Les

Posted

what are the errors from compiling?  what can happen is you get "unprintable" characters somehow in the ide.  copy+paste into a browser text box might convert them into someother character.  there are all kinds of strange ways this can happen.

if you get very odd things like this you might need to look at the actual file in a hex editor, to see what characters are really there or fix them.

i'd also suggest using something like git/github for source control, even if you don't plan on ever sharing code with anyone else, being able to see history of your changes and go back to previous versions/etc is super handy.  plus with something like github you have an offsite copy in case anything goes wrong.  

Posted

Thanks for that - I never thought of Github, like a lot of these sites I use it for downloading stuff but didn't really pay any attention to what it is!

As for the character error thing, I'm not sure if it was that or not; it was coming up with lots of errors, tons of XXX is not a member of DCS BIOS, that type of thing

Cheers

  • Recently Browsing   0 members

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