MarkBLN Posted April 22, 2023 Share Posted April 22, 2023 Thanks. I'll have a look tomorrow and see Link to comment Share on other sites More sharing options...
MarkBLN Posted April 23, 2023 Share Posted April 23, 2023 None of my pots work, so I guess I messed up the wiring. How should they be wired? Just 2 wires, ground and to a pin, or 3 wires ground, 5v and to a pin? Link to comment Share on other sites More sharing options...
lesthegrngo Posted April 23, 2023 Share Posted April 23, 2023 48 minutes ago, MarkBLN said: None of my pots work, so I guess I messed up the wiring. How should they be wired? Just 2 wires, ground and to a pin, or 3 wires ground, 5v and to a pin? Take a look here https://docs.arduino.cc/built-in-examples/basics/AnalogReadSerial Link to comment Share on other sites More sharing options...
No1sonuk Posted April 23, 2023 Share Posted April 23, 2023 1 hour ago, MarkBLN said: None of my pots work, so I guess I messed up the wiring. How should they be wired? Just 2 wires, ground and to a pin, or 3 wires ground, 5v and to a pin? 3 wires. Link to comment Share on other sites More sharing options...
MarkBLN Posted April 23, 2023 Share Posted April 23, 2023 21 hours ago, No1sonuk said: OR: void onSelJettKnobChange(unsigned int newValue) { if (newValue = 1) { digitalWrite(LEDpin, LOW); } // 1 is the value for SAFE else { digitalWrite(LEDpin, HIGH); } } DcsBios::IntegerBuffer selJettKnobBuffer(0x7480, 0x0e00, 9, onSelJettKnobChange); Where do I reference the pin for the LED I want to illuminate in this code? Link to comment Share on other sites More sharing options...
No1sonuk Posted April 23, 2023 Share Posted April 23, 2023 (edited) "LEDpin" is the constant for it. You can either replace that with the number, or put this at the beginning of your code: #define LEDpin 3 // 3 is the LED's pin number Edited April 23, 2023 by No1sonuk Link to comment Share on other sites More sharing options...
MarkBLN Posted April 23, 2023 Share Posted April 23, 2023 I tried the code with that and didn't work. I tired some other code to just get the light to light up and it's lighting fine, so seems the code isn't right for what I'm trying to do sadly. I'll mess around more tomorrow and see if I have any luck. Thanks for the help. Link to comment Share on other sites More sharing options...
MarkBLN Posted April 24, 2023 Share Posted April 24, 2023 On 4/22/2023 at 10:29 PM, No1sonuk said: OR: void onSelJettKnobChange(unsigned int newValue) { if (newValue = 1) { digitalWrite(LEDpin, LOW); } // 1 is the value for SAFE else { digitalWrite(LEDpin, HIGH); } } DcsBios::IntegerBuffer selJettKnobBuffer(0x7480, 0x0e00, 9, onSelJettKnobChange); Thanks mate, this worked once I added == instead of = Happy to have it all working now though. One funny issue is that when the button LED is triggered by the above command the light is very dim, whereas if I use some code to let's say just light the button when the landing gear is down then it is fully bright. I can't figure out what is it about this specific code that limits the light output of the LED? Link to comment Share on other sites More sharing options...
No1sonuk Posted April 24, 2023 Share Posted April 24, 2023 Sorry, I forgot the == thing. As for the dim light, it might be turning on and off very quickly for some reason, rather than staying on. Try !=1 in the if statement and switching the HIGH and LOW. 1 Link to comment Share on other sites More sharing options...
MarkBLN Posted April 24, 2023 Share Posted April 24, 2023 (edited) Figured it out. in the section at the end that says.. void setup() { DcsBios::setup(); } I added... pinMode(A13, OUTPUT); pinMode(A14, OUTPUT); pinMode(15, OUTPUT); Now the LEDs are full brightness. Here's the finished result. Made from MDF, HDF, carbon fiber foil, pin striping tape and a hand label punch. Only have a handsaw and battery screwdriver that I borrowed from a mate So I'm happy with the result considering the limited resources. Edited April 24, 2023 by MarkBLN Link to comment Share on other sites More sharing options...
No1sonuk Posted April 25, 2023 Share Posted April 25, 2023 Nice job. Especially with the limited tools. Setting the pin modes is something else I forgot. DCS-BIOS does it automatically when it's a built-in function, but the code within the onchange functions doesn't. This is because it's a normal Arduino code function. Having said that, I think there's a difference in the analogue pins. Link to comment Share on other sites More sharing options...
MarkBLN Posted April 25, 2023 Share Posted April 25, 2023 (edited) Cheers. Ya the problem was the code I was using wasn't specifically referring to LEDs. The issue was on both digital and analog pins. The 2 different cases I had was firstly, I wanted the backlit selective jettison button to be off when the select jettison dial was set to safe, then illuminate when set to any other setting apart from safe. That's the one you helped me with the code for. The other case was to mimic a magnetic switch for the engine crank. I have 2 LEDs, one each side of the crank switch. My switch is momentary, not latched. So how it works is when I press it to the right the in game switch moves to the right and latches, then my right hand light illuminates to simulate this. Then when the engine has started successfully and the ingame switch is released to centre, the right hand light goes off. Then this is repeated with the left side. So ya, both of those sets of LEDs were the ones that were dim until I put in the code to specify that they were output pins. Edited April 25, 2023 by MarkBLN 1 Link to comment Share on other sites More sharing options...
Neville Posted May 8, 2023 Share Posted May 8, 2023 Am 21.4.2023 um 19:22 schrieb No1sonuk: When you run the Hub installer, it does it for you. On the Tek Creations link, there's another to the DCS-BIOS Hub installation instructions. I don't remember exactly what happens with the install, and I don't use Hub any more as it's woefully out of date. It looks like they created their own Hub plug-in too. Hello, it's me again. Kieron from Tek Creation can't figure out what's going on either. The problem is that DCS doesn't seem to be sending any data to the Bios Hub. Although the program displays Virtual Cockpit. Apparently the rest is o.k. Maybe someone has an idea Link to comment Share on other sites More sharing options...
Vinc_Vega Posted May 8, 2023 Share Posted May 8, 2023 Same here. Flightpanel's version of DcsBios is not sending data for the A-10C II. Socat is running normal, data are shown. In contradiction to that, for the F-16 and Bf-109 all seem okay and data can be received by an Arduino. No idea so far. Regards, Vinc Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
BlackLibrary Posted May 8, 2023 Share Posted May 8, 2023 (edited) try latest release of flightpanels. A-10C 2 should work Hub will be more and more outdated Edited May 8, 2023 by BlackLibrary aka WarLord DCSFlightpanels DCS-BIOS Fork DCSFlightpanels arduino-library DCSFlightpanels DCSFlightpanels-Profiles DCS FP / BIOS Discord Server Link to comment Share on other sites More sharing options...
Neville Posted May 12, 2023 Share Posted May 12, 2023 Thanks for the answer. But that doesn't explain to me why my dcs and the dcs bios aren't communicating data with each other. my Dcs is on drive E and the savegame on C, maybe that's the problem Link to comment Share on other sites More sharing options...
No1sonuk Posted May 13, 2023 Share Posted May 13, 2023 On 5/12/2023 at 10:03 AM, Neville said: Thanks for the answer. But that doesn't explain to me why my dcs and the dcs bios aren't communicating data with each other. my Dcs is on drive E and the savegame on C, maybe that's the problem I have them split between different drives myself. That's not the problem. It's more likely that the Hub version of DCS-BIOS doesn't work properly anymore after the many DCS updates since Hub went unmaintained. Don't forget the A-10CII just had a major update with the ARC-210 being implemented. That's likely had a knock-on effect on the rest of the code for that aircraft. Link to comment Share on other sites More sharing options...
byteman59 Posted May 14, 2023 Share Posted May 14, 2023 Anybody have issues with the ELEGOO UNO R3? First time using this Arduino UNO from amazon. Just finished uploading the code for the Fuel Control Panel and it seems to hang when starting DCS-BIOS Fork version. Computer is detecting Arduino correctly. Tried one of my other panels and DCS-BIOS works fine. Using latest BSC-BIOS Fork. Below is code. thanks in advance! #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" // FUEL CONTROL PANEL // Aerial Refueling Slipway Control Lever DcsBios::RotaryEncoder fscpRcvrLever("FSCP_RCVR_LEVER", "DEC", "INC", 12, 11); // Boost Pumps Left Wing DcsBios::Switch2Pos fscpBoostWingL("FSCP_BOOST_WING_L", 15); // Boost Pumps Right Wing DcsBios::Switch2Pos fscpBoostWingR("FSCP_BOOST_WING_R", 14); // Boost Pumps Main Fuselage Left DcsBios::Switch2Pos fscpBoostMainL("FSCP_BOOST_MAIN_L", 19); //Boost Pumps Main Fuselage Right DcsBios::Switch2Pos fscpBoostMainR("FSCP_BOOST_MAIN_R", 18); // Crossfeed DcsBios::Switch2Pos fscpCrossfeed("FSCP_CROSSFEED", 2); //External Fuselage Tanks Boost Pumps DcsBios::Switch2Pos fscpExtTanksFus("FSCP_EXT_TANKS_FUS", 1); // External Wing Tanks Boost Pumps DcsBios::Switch2Pos fscpExtTanksWing("FSCP_EXT_TANKS_WING", 16); //Fill Disable Main Left DcsBios::Switch2Pos fscpFdMainL("FSCP_FD_MAIN_L", 6); //Fill Disable Main Right DcsBios::Switch2Pos fscpFdMainR("FSCP_FD_MAIN_R", 5); //Fill Disable Wing Left DcsBios::Switch2Pos fscpFdWingL("FSCP_FD_WING_L", 4); // Fill Disable Wing Right DcsBios::Switch2Pos fscpFdWingR("FSCP_FD_WING_R", 3); // Line Check DcsBios::Switch2Pos fscpLineCheck("FSCP_LINE_CHECK", 13); // Signal Amplifier NORM - OVERRIDE DcsBios::Switch2Pos fscpAmpl("FSCP_AMPL", 0); // TK Gate DcsBios::Switch2Pos fscpTkGate("FSCP_TK_GATE", 17); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Link to comment Share on other sites More sharing options...
No1sonuk Posted May 14, 2023 Share Posted May 14, 2023 41 minutes ago, byteman59 said: Anybody have issues with the ELEGOO UNO R3? First time using this Arduino UNO from amazon. Just finished uploading the code for the Fuel Control Panel and it seems to hang when starting DCS-BIOS Fork version. Computer is detecting Arduino correctly. Tried one of my other panels and DCS-BIOS works fine. Using latest BSC-BIOS Fork. Below is code. //External Fuselage Tanks Boost Pumps DcsBios::Switch2Pos fscpExtTanksFus("FSCP_EXT_TANKS_FUS", 1); // Signal Amplifier NORM - OVERRIDE DcsBios::Switch2Pos fscpAmpl("FSCP_AMPL", 0); You're using pins 0 and 1. That disrupts the data connection because they're the pins the Atmega328p uses to communicate with the USB controller. Try disconnecting those two switches. Link to comment Share on other sites More sharing options...
byteman59 Posted May 15, 2023 Share Posted May 15, 2023 5 hours ago, No1sonuk said: You're using pins 0 and 1. That disrupts the data connection because they're the pins the Atmega328p uses to communicate with the USB controller. Try disconnecting those two switches. Same result. Link to comment Share on other sites More sharing options...
No1sonuk Posted May 15, 2023 Share Posted May 15, 2023 Is that after starting a mission/flight? Link to comment Share on other sites More sharing options...
byteman59 Posted May 15, 2023 Share Posted May 15, 2023 1 hour ago, No1sonuk said: Is that after starting a mission/flight? No before. after i hit continue, nothing happens. With the Mega, i see data scrolling. Link to comment Share on other sites More sharing options...
hrnet940 Posted May 16, 2023 Share Posted May 16, 2023 Don't use those two pins, ever! Wayne Wayne Wilson AKA: hrnet940 Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD. Link to comment Share on other sites More sharing options...
byteman59 Posted May 16, 2023 Share Posted May 16, 2023 10 hours ago, hrnet940 said: Don't use those two pins, ever! Wayne I have confirmed with Arduino that those two pins can be used for Digital I/O. Why do you say do not use? Link to comment Share on other sites More sharing options...
Simpit Posted May 16, 2023 Share Posted May 16, 2023 Anyone who can give me a DCS_BIOS-script for an on/off-function of the F-16 speed-brake? Kind regards Hans Dieter System: Win 11 Prof, 64 Bit, AMD 4350 Quad-Core, Gigabyte-Board 970A-UD3P, 16 GB-RAM; ASUS GTX 1080 8 GB - Nvidia Geforce Link to comment Share on other sites More sharing options...
Recommended Posts