Jump to content

Vinc_Vega

Members
  • Posts

    640
  • Joined

  • Last visited

Everything posted by Vinc_Vega

  1. Maybe you have other than 4 steps per detents encoders, than the code has to be adapted. Have a look into the DcsBios "Code Snippet Reference". Or you have to debounce the encoder. For the test code I used a standard KY-040 rotary, that already has all the resistors on board. Alternative you may use a 10k potentiometer for the sea level knob. Shold be easier to do than an encoder and analoge input pins could be used. Code than may need to be adjusted something like below (didn't try it yet). DcsBios::PotentiometerEWMA<5, 128, 5> altPressSet("ALT_PRESS_SET", PIN); Regards, Vinc
  2. Hi Johan, what kind of rotary encoder do you have? You also may use "-6400" / "+6400" for the values or "DEC" and "INC". Regards, Vinc
  3. Hi Johan you have to install the AccelStepper library with the Arduino IDE first. Regards, Vinc
  4. No, this time the mapping can be done linear for the altimeter (not like that of the Mig-21's rad alt). I have read out, mapped the values and put it temporary on a LCD display. All displayed values were perfectly in line with the respective gauge positions in the cockpit. PS: have a look here for non linear solution https://forum.dcs.world/topic/208455-dcs-bios-over-rs485/?do=findComment&comment=5168699 Regards, Vinc
  5. No, for the standard USB mode just leave it as it is. For the RS485 option (later) delete the first two slashes. As you may see, I connected the encoder to pins D3 and D4 and the stepper for the km-disk to pins D5 to D8. Regards, Vinc
  6. Hi Johan, You may use te below sketch for the altimeter kilometre disk and the pressure set knob. It still has death code for the needle and the pressure scale. Depending on your kilometre disk layout (0 to 9 or 0 to 13), if the scale has 315 or 360 degrees and if you use further reduction gears we may have to adjust it. PS: I put in a compiler switch at the top if you want to try the sketch with the RS485 option. Regards, Vinc
  7. EDIT Below are arguments and addresses of the altimeter gauge for further use. 1) Instrument needle displays the altitute from 0 to 1.000 metres at a round dial // Altimeter Needle in meters (0-1.000 m) void onAltimeterFineptrChange(unsigned int newValue) { stepper.runToNewPosition(map(newValue, 0, 56535, 0, 1260)); } DcsBios::IntegerBuffer altimeterFineptrBuffer(0x4248, 0xffff, 0, onAltimeterFineptrChange); 2) the lower window shows the altitude in kilometres from 0 to 13 (or better in metres to 13.000) // Altimeter kilometer disk (0-13.000 m) void onAltimeterCoarseptrChange(unsigned int newValue) { stepper.runToNewPosition(map(newValue, 0, 56535, 0, 1260)); } DcsBios::IntegerBuffer altimeterCoarseptrBuffer(0x424a, 0xffff, 0, onAltimeterCoarseptrChange); 3) the barometric pressure scale shows values from 920 to 1040 mbar // Altimeter barometric pressure (920 - 1040 mbar) void onAltimeterPressureChange(unsigned int newValue) { stepper.runToNewPosition(map(newValue, 0, 56535, 0, 1260)); } DcsBios::IntegerBuffer altimeterPressureBuffer(0x424c, 0xffff, 0, onAltimeterPressureChange); 4) for the pressure setting knob, the input command line can be used from DcsBios to connect rotary encoders DcsBios::RotaryEncoder altPressSet("ALT_PRESS_SET", "-3200", "+3200", PIN_A, PIN_B); So the next step would be, to merge the stepper code with the lines for the km-indication window to bring the "normal" stepper to life and to connect a rotary to see the DcsWorld reaction. Regards, Vinc
  8. Yes Johan, I'll try to help you with the code. But I have to say that I'm not a programmer and everything I know is more or less from the internet. First I have to re-install the 109 as I unfortunately didn't use that beauty for years, to see the DcsBios fragments. Regards, Vinc
  9. No, unfortunately only Megas will work as masters. But each Mega can support up to 3 RS485 buses. Edit: As a slave, the Mega, Uno and Nano boards do work. Regards, Vinc
  10. Looks good so far but you may have to change some pins. Look at the first sketch here for swapped pins D5 and D6 within the AccelStepper declaration (3,4,6,5). Beware off, that standard TX_Enable pin at the Nano is D2 or you have to declare another pin within your sketch. Furthermore, D13 is not good as input pin as there already is the onboard LED connected to it. Use that pin as an output or de-solder the LED (not recommended). You may use the analog pins as digital inputs as well. For the RS485 master only an Arduino Mega works. Regards, Vinc
  11. Sorry to hear that. Keep your head up right now! If you need any help or support, PM me. I'm living next to you in Bavaria. Regards, Vinc
  12. As there are cheap Mega clones on the market, additionally you may swap TX0 with RX0. Regards, Vinc
  13. Just use the first 6 digits to display your "Line1Text" and the 8th digit to display the waypoint number. Spare out the 7th digit, set a space charracter to it or use it for a two digits waypoint number. something like that (just a rough estimate) void onPviLine1TextChange(char* new value) { lc.setChar(0,7,newValue[0],false); lc.setChar(0,6,newValue[1],false); lc.setChar(0,5,newValue[2],false); lc.setChar(0,4,newValue[3],false); lc.setChar(0,3,newValue[4],false); lc.setChar(0,2,newValue[5],false); } DcsBios::StringBuffer ... ... void onPviLine1PointChange(char* newValue) { lc.setChar(0,0,newValue,false); } DcsBios::StringBuffer ... EDIT: if "new Value" would be an integer (int) use the lc.setDigit command. Btw. the "true" or "false" within the brackets switches the decimal point of the respective digit on or off. Have a look ->here<- for reference of the ledcontrol-library. Regards, Vinc
  14. I personally have not tryed out the zero detection so far, therefore I have no code examples. But, have you already read these postings? Regards, Vinc
  15. Is there a special reason not to put the last two lines within any loop? u8g.begin();// Initialize displays u8g.setFont(u8g_font_helvB18); // standard nice size font for displays I recommend to do your initializations (and the standard font) within the SETUP loop. May you point us to the top left display within your code please? Regards, Vinc
  16. We recently had a discussion on that topic. Maybe you find the solution by using TX0 / RX0 of the Mega? Regards, Vinc
  17. Yes, the "map" function is to match one linear range of values to values of another linear range. If you want to match non linear ranges, you have to use a kind of multimapping function or a dedicated library. See below for some code fragments. My interpretation of internet multimap code, a few years ago for the MiG-21's radar altimeter non linear scaling. Regards, Vinc
  18. OLEDs don't have backlight. If it were a LCD you may have a chance to see anything by connecting the backlight LED pins to power. Regards, Vinc
  19. Do not use the "er_oled.h" library from East Rising, as it can only be used with their own examples. Try to start with adafruits gfx library or use the u8g2 library for your display. Regards, Vinc
  20. Hi Johan, If you are looking for plug and play code you probably are not in the right forum here. We mostly are hobbyists, having learned how to design and produce panels and deal with microcontrollers and their programming over years within that community. As almost nobody uses the same hardware / software combination here, we only may suggest parts of a technical solution and point you into a new direction. Depending on your implementation and feedback of results, we may bring you a step further to finalize your product. So if you would show us parts of your code, we may look through it and post ideas to bring it to work. Please don’t expect full code examples for exotic airplanes like the Bf-109 or so, as most of us started with the A-10, F-18 or similar modern jets. The X27 stepper should work like that X25.168 from the example above, adjustment of the values are “trial and error” and best guesses. The example is documented, so you even may adjust the steps and steps per degree of your motors. For the modified one you have to provide us with more details on your modification. As I personally don’t know the Vid26 stepper, you probably may point to a respective data sheet to see if we can help. Regards, Vinc
  21. Hi Les, version 1.4.0 25/4/20 is still working fine for me, at my Win10 x64 laptop. That should be the latest available on Bobobear's github. I remember, that you already had issues with the application when using certain USB sticks. Regards, Vinc
  22. Yes, the original panels of a Phantom were backlit. As far as I remember, their lights had a slightly red colour. Regards, Vinc
  23. Yes, like at the IFF panel. Those are the old style panels, remaining from the A version when converted into the A-10C standard. As the backlighting mostly is done from behind the panels, I didn't reproduced the bulb housings for the Sim. Regards, Vinc
  24. The lower "button" of the not clickables is the housing for a backlight bulb Regards, Vinc
  25. Hi Les, do you mean the Oxygen Indicator Test Button? DcsBios::Switch2Pos envcpOxyTest("ENVCP_OXY_TEST", PIN); Regards, Vinc
×
×
  • Create New...