Jump to content

My A10 SimPit


byteman59

Recommended Posts

First off, I'd like to thank The Warthog Project. My panels are based off of his designs. And thanks to all the members of this site who have helped me along the last few months. I have been at this since January of 22. Special shout out to No1sonuk, thanks for being patient with my questions!

I have completed my first panels. The Intercom, Antenna and Stall System Volume Panels.

I have run into a couple of issues. When i start game play, not all switches are synced with their current positions in DCS.

How do i resolve this? I have uploaded my code file.

Second, my encoders tend to turn the knobs in DCS at a faster rate. Is it possible to slow this down?

 

Thanks again!

 

 

 

intercom.jpg

INTERCOM_PANEL.ino

20220619_193408.jpg


Edited by byteman59
Link to comment
Share on other sites

46 minutes ago, byteman59 said:

First off, I'd like to thank The Warthog Project. My panels are based off of his designs. And thanks to all the members of this site who have helped me along the last few months. I have been at this since January of 22. Special shout out to No1sonuk, thanks for being patient with my questions!

I have completed my first panels. The Intercom, Antenna and Stall System Volume Panels.

I have run into a couple of issues. When i start game play, not all switches are synced with their current positions in DCS.

How do i resolve this? I have uploaded my code file.

Second, my encoders tend to turn the knobs in DCS at a faster rate. Is it possible to slow this down?

 

Thanks again!

 

 

 

 

Try adding a delay in your loop.  As always the disclaimer is I don't code for actual Arduino, so the syntax might be slightly different (I really should dust off my Arduino and write a couple sketches for it)...

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

 


Edited by Raisuli
Old age. Or fat fingers. I'm sticking to the latter...
Link to comment
Share on other sites

Oh, and PLEASE don't take this critically, but you will love yourself later if you clean up your wiring.  Trust me.  One of these days I'll send a picture of the far messier wiring I allowed to persist on the last iteration of my pit, and it was a major pain in my posterior.  Worse, I already knew better, so that was all on me.

Link to comment
Share on other sites

Switch sync: I don't think DCS-BIOS sends all switch positions when it starts - only when you change them.

In some ways that's a good thing. It means you won't need to go round setting everything if you run a hot start.

Encoders: They are probably 2 or 4 pulse per detent. Someone posted how to stop that by defining a new encoder type. I'll search for that later.

Link to comment
Share on other sites

9 minutes ago, No1sonuk said:

Switch sync: I don't think DCS-BIOS sends all switch positions when it starts - only when you change them.

In some ways that's a good thing. It means you won't need to go round setting everything if you run a hot start.

Encoders: They are probably 2 or 4 pulse per detent. Someone posted how to stop that by defining a new encoder type. I'll search for that later.

Switch sync: just to be clear, using the Dial Knob. When i start game play, my dial would be on INT, but DCS shows that it is on VHF until I move dial once, then they sync.

Encoders: Thanks for searching.


Edited by byteman59
Link to comment
Share on other sites

41 minutes ago, byteman59 said:

Switch sync: just to be clear, using the Dial Knob. When i start game play, my dial would be on INT, but DCS shows that it is on VHF until I move dial once, then they sync.

Encoders: Thanks for searching.

 

the encoders I use are 4/indent.  This is the code I came up with to do single click per indent

#include<stdDisclaimers.h>

long encoderPosition  = 0;

void loop() {
  // Let's look at the encoder first
  long newPos;
  newPos = encoder.read();
  if (newPos != encoderPosition) {
    if ( (newPos - encoderPosition) >= 4)
    {
      Serial.println("Click Right!");
      Joystick.button(clickRightButton, 1);
      encoderPosition = newPos;
    } else if ( (newPos - encoderPosition) <= -4)
    {
      Serial.println("Click Left!");
      Joystick.button(clickLeftButton, 1);
      encoderPosition = newPos;
    } 
  } else
  {
    Joystick.button(clickRightButton, 0);
    Joystick.button(clickLeftButton, 0);
  }

 

Link to comment
Share on other sites

34 minutes ago, Raisuli said:

the encoders I use are 4/indent.  This is the code I came up with to do single click per indent

#include<stdDisclaimers.h>

long encoderPosition  = 0;

void loop() {
  // Let's look at the encoder first
  long newPos;
  newPos = encoder.read();
  if (newPos != encoderPosition) {
    if ( (newPos - encoderPosition) >= 4)
    {
      Serial.println("Click Right!");
      Joystick.button(clickRightButton, 1);
      encoderPosition = newPos;
    } else if ( (newPos - encoderPosition) <= -4)
    {
      Serial.println("Click Left!");
      Joystick.button(clickLeftButton, 1);
      encoderPosition = newPos;
    } 
  } else
  {
    Joystick.button(clickRightButton, 0);
    Joystick.button(clickLeftButton, 0);
  }

 

Thanks, fairly new to arduino and DCS-BIOS.

How would i incorporate your code with mine?

 

 

Link to comment
Share on other sites

8 minutes ago, byteman59 said:

Thanks, fairly new to arduino and DCS-BIOS.

How would i incorporate your code with mine?

 

 

THAT is a brilliant question, and I don't have an answer.  Mostly because I won't use a browser written by an advertising company and haven't gotten into DCS-BIOS.  For now I just use joystick inputs mapped in DCS.  The advantage, maybe, is I can use controls to do different things in each aircraft, because my pit isn't dedicated to a single aircraft.

The REAL downside is mapping 300+ controls in every aircraft, and I have them all, is a PITA.  Probably part of the reason only a handful get flown.

The other downside is I don't get feedback from DCS and can't do cool things like mirroring UFC displays in my pit.  My gut is eventually I will have a combination of DCS-BIOS for communication from DCS to the pit and and joystick inputs.  That's a guess at this point.

Some day my throttles will move when I use auto throttle (assuming I live that long), but...small steps.  Some day my panels will be illuminated like yours, but not this iteration  🙂

Link to comment
Share on other sites

17 minutes ago, Raisuli said:

THAT is a brilliant question, and I don't have an answer.  Mostly because I won't use a browser written by an advertising company and haven't gotten into DCS-BIOS.  For now I just use joystick inputs mapped in DCS.  The advantage, maybe, is I can use controls to do different things in each aircraft, because my pit isn't dedicated to a single aircraft.

The REAL downside is mapping 300+ controls in every aircraft, and I have them all, is a PITA.  Probably part of the reason only a handful get flown.

The other downside is I don't get feedback from DCS and can't do cool things like mirroring UFC displays in my pit.  My gut is eventually I will have a combination of DCS-BIOS for communication from DCS to the pit and and joystick inputs.  That's a guess at this point.

Some day my throttles will move when I use auto throttle (assuming I live that long), but...small steps.  Some day my panels will be illuminated like yours, but not this iteration  🙂

I totally understand. I will see if you code can get me started.

Thanks!

Link to comment
Share on other sites

Rotary encoders:
It was in Discord I was pointed to the DCSFP Wiki here:
https://github.com/DCSFlightpanels/dcs-bios-arduino-library/wiki/RotaryEncoder

Example 2:

typedef DcsBios::RotaryEncoderT<POLL_EVERY_TIME, DcsBios::FOUR_STEPS_PER_DETENT> FourStepRotaryEncoder; // A custom rotary encoder with four quadrature steps per physical detent.

FourStepRotaryEncoder tacan1("TACAN_1", "DEC", "INC", 0, 1);

Once you've done the typedef line, the "FourStepRotaryEncoder" can be called in any line in place of "DcsBios::RotaryEncoder".

Link to comment
Share on other sites

4 minutes ago, No1sonuk said:

Rotary encoders:
It was in Discord I was pointed to the DCSFP Wiki here:
https://github.com/DCSFlightpanels/dcs-bios-arduino-library/wiki/RotaryEncoder

Example 2:

typedef DcsBios::RotaryEncoderT<POLL_EVERY_TIME, DcsBios::FOUR_STEPS_PER_DETENT> FourStepRotaryEncoder; // A custom rotary encoder with four quadrature steps per physical detent.

FourStepRotaryEncoder tacan1("TACAN_1", "DEC", "INC", 0, 1);

Once you've done the typedef line, the "FourStepRotaryEncoder" can be called in any line in place of "DcsBios::RotaryEncoder".

Thank as always, will give it try.

Link to comment
Share on other sites

19 hours ago, No1sonuk said:

Rotary encoders:
It was in Discord I was pointed to the DCSFP Wiki here:
https://github.com/DCSFlightpanels/dcs-bios-arduino-library/wiki/RotaryEncoder

Example 2:

typedef DcsBios::RotaryEncoderT<POLL_EVERY_TIME, DcsBios::FOUR_STEPS_PER_DETENT> FourStepRotaryEncoder; // A custom rotary encoder with four quadrature steps per physical detent.

FourStepRotaryEncoder tacan1("TACAN_1", "DEC", "INC", 0, 1);

Once you've done the typedef line, the "FourStepRotaryEncoder" can be called in any line in place of "DcsBios::RotaryEncoder".

That did not seem to work. My server is still using DCSBIOS older version, not flighpanels. But i am able to adjust  the default "3200" to get the desired effect.

DcsBios::RotaryEncoder intAimVol("INT_AIM_VOL", "-2400", "+2400", 0, 1);

 

As for syncronization: found the following code that works.

https://github.com/DCSFlightpanels/dcs-bios-arduino-library/tree/master/examples/Synchronization

 

***************************************************************

DcsBios::ProtocolParser parser;

unsigned long lastTickMillis;

void setup() {
  DcsBios::setup();
  lastTickMillis = millis();
}

void timerTick()
{
// The timer has expired.  Issue a mass reset to all controls.  Safe, but may generate additional traffic if you have many controls.
 DcsBios::resetAllStates();

}
 
void loop() {
  DcsBios::loop();
  
   unsigned long now = millis();
  if(now - lastTickMillis > 10000)
  {
   timerTick();
   lastTickMillis = now;
}

}

*********************************************************

Link to comment
Share on other sites

5 hours ago, byteman59 said:

That did not seem to work. My server is still using DCSBIOS older version, not flighpanels. But i am able to adjust  the default "3200" to get the desired effect.

DcsBios::RotaryEncoder intAimVol("INT_AIM_VOL", "-2400", "+2400", 0, 1);

I tried it again, and it worked in both Flightpanels AND Hub.  The only thing I can think of is that it doesn't work with "INC" and "DEC" on controls that take numbers like "-2400".
I put the numbers in and it worked fine.
 

/*
  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
#define DCSBIOS_DEFAULT_SERIAL

#include "DcsBios.h"

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

typedef DcsBios::RotaryEncoderT<POLL_EVERY_TIME, DcsBios::FOUR_STEPS_PER_DETENT> FourStepRotaryEncoder; // A custom rotary encoder with four quadrature steps per physical detent.

//FourStepRotaryEncoder uhf1mhzSel("UHF_1MHZ_SEL", "DEC", "INC", 3, 2);
FourStepRotaryEncoder intAimVol("INT_AIM_VOL", "-2400", "+2400", 3, 2);

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

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

 

Link to comment
Share on other sites

I tried again using numbers but no luck, will try again using DEC and INC.

In the meantime, i did get the desired results using the following settings.

For some reason the AIM volume control moves in fewer increments than the other volume controls, reason why i needed to set at 3640

DcsBios::RotaryEncoder intAimVol("INT_AIM_VOL", "-3640", "+3640", 0, 1);

DcsBios::RotaryEncoder intIffVol("INT_IFF_VOL", "-910", "+910", 16, 17);

DcsBios::RotaryEncoder intFmVol("INT_FM_VOL", "-910", "+910", 11, 12);

DcsBios::RotaryEncoder intFmVol("INT_FM_VOL", "-910", "+910", 11, 12);

DcsBios::RotaryEncoder intIntVol("INT_INT_VOL", "-910", "+910", 13, 7);

DcsBios::RotaryEncoder intTcnVol("INT_TCN_VOL", "-910", "+910", 42, 40);

DcsBios::RotaryEncoder intUhfVol("INT_UHF_VOL", "-910", "+910", 62, 66);

DcsBios::RotaryEncoder intVhfVol("INT_VHF_VOL", "-910", "+910", 63, 59);

Link to comment
Share on other sites

  • 1 month later...

Here is my Fight Control Panel. On the back i created a connector that connects to the Intercom panel Arduino. Still need to 3D print cap for Flt Ctl Switch. The 2-wire connector is for back lighting that will be connected to 12V though out sim. Special thanks to The Warthog Project for the panel files.

On to the Aux Lights Panel!

20220811_213540.jpg

20220811_213510.jpg

Link to comment
Share on other sites

  • 5 months later...

Finally finished IFF, SAS and Aux panels. IFF is scratch built, with the techniques that i have learned from all of you! I can make those files available if interested. I can also make available the stl files for the Knobs.

Thanks to the Warthog Project!
null

 

image.jpeg

20230206_205348.jpg

20230206_205253.jpg

20230206_205305.jpg

20230206_205220.jpg

20230206_205226.jpg

  • Like 2
Link to comment
Share on other sites

Really sharp looking lettering, is it back lit? really a nice looking IFF panel  great work you should be very happy with it. Cheers

https://www.shapeways.com/shops/a-10c-warthog-supplies

https://forum.dcs.world/topic/133818-deadmans-cockpit-base-plans/#comment-133824

CNCs and Laser engravers are great but they can't do squat with out a precise set of plans.

Link to comment
Share on other sites

7 hours ago, Rapti said:

Great work! Is your IFF fully functional? Do you have any arduino Code for the thumb wheels?
This is the the Pit of a friend and me. Still a lot to do. 7266183c1860efce0581732ac90d53e5.jpg

Gesendet von meinem SM-G988B mit Tapatalk
 

Great looking sim. I figured if i build structure i would get lazy and play to much instead of building panels! Will build left console after all panels are complete.

Yes, it is functional. Here is the code. Got help from others on this forum!

IFF_PANEL_BcdWheel.ino


Edited by byteman59
  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

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