SrSosio Posted June 12 Author Posted June 12 I managed to get the Dynamic sketch to work, for the moment, just using the switch. That's a great improvement though, I could just leave it here, but it'd be great if I could handle it with the seat variable. Attaching the current working sketch, in case you want to have a look at it. KU-DCS_BIOS_dynamic.ino
Vinc_Vega Posted June 12 Posted June 12 (edited) The seat function expects an integer but your status variable may still be declared as bool. I'll later have a look into the new sketch. Regards, Vinc Edited June 12 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
Vinc_Vega Posted June 12 Posted June 12 (edited) @SrSosio As expected, you may have to change the declaration of bool status into int status to use the onSeatPositionChange function, even if the output would be either 0 or 1. Regards, Vinc Edit: it's a really great hack to use the dynamic sketch to even swith the function of a whole panel. Respect! Edited June 12 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
No1sonuk Posted June 12 Posted June 12 From the addresses.h file: #define AH_64D_SEAT_POSITION 0x8750, 0x0100, 8 So if you weren't giving it all 3 of those numbers, it won't work.
SrSosio Posted June 13 Author Posted June 13 9 hours ago, No1sonuk said: From the addresses.h file: #define AH_64D_SEAT_POSITION 0x8750, 0x0100, 8 So if you weren't giving it all 3 of those numbers, it won't work. I've now checked, and I do have that file, however, there are some things that make me think it's not the right one (even though I downloaded dcs-bios from the github just a few days ago for the first time, so I should have the latest version): #define AH_64D_SEAT_POSITION 0x8750, 0x0100, 8 I don't have that line in my file For the display (CPG, for example) bort says this: but my addresses.h file says: #define AH_64D_CPG_KU_DISPLAY_ADDR 0x80AC, that's why I had to use the value instead of the variant. I'll check out the github, see if I can find the file updated. Edit: found it! but probably the one in the zip folder in the release file should be replaced, unless you are expected to replace it afterwards as I had to do now.
SrSosio Posted June 13 Author Posted June 13 So the final code is finished and working (attached). The only thing not working is the APU led, which is a korry with 2 leds, hence why I duplicated the line. It may be because it's in a different device (the throttle quadrant) and the ground is not common to the Mega, only the two output lines are coming out of it. So those LEDs have the ground connected to the throttle quadrant USB, but the anodes are connected to the KU's Mega. I'd think any USB device plugged into the computer should have the same ground, shouldn't it? KU-DCS_BIOS_dynamic.ino
SrSosio Posted June 13 Author Posted June 13 (edited) I've tested the Mega pins directly with a multimeter, and I should expect 5V coming out of the pin when the APU is on, shouldn't I? but I get nothing, so I'm wondering whether the code is wrong, or the mega is busted. Bort is not recognizing that output either, so I'm not sure what's wrong then. Maybe that line doesn't actually refer to the APU led, or maybe it's not properly coded in DCS BIOS. @No1sonuk any ideas? Edited June 13 by SrSosio
SrSosio Posted June 13 Author Posted June 13 I found it! I was using the wrong formula. This is the right one: DcsBios::LED pltApuL(AH_64D_PLT_APU_L_AM, PIN);
Recommended Posts