Jump to content

Vinc_Vega

Members
  • Posts

    640
  • Joined

  • Last visited

Everything posted by Vinc_Vega

  1. I mean the sketch you posted 7 hours ago and that is missing the DcsBios::setup line. Regards, Vinc
  2. Have you tried your above code for the single digit and corrected the DcsBios::setup() line? Regards, Vinc
  3. The StringBuffer line is missing for the bottom line content. And btw. that should only hold one char <1> Regards, Vinc
  4. Hi Johan, thanks for sharing your solution and the clip. I really like your project and am interested in the progress. Maybe I built such a warbird instrument panel by myself someday. Which instrument exactly do you mean by "compass" ? How do you plan to reproduce the round counter and the Revi? Regards, Vinc
  5. I can't see the DcsBios statement in the Setup routine. That may cause an issue. Put the following line as the first statement behind void setup() { DcsBios::setup(); Regards, Vinc
  6. As serial output doesn't work with DcsBios, you may readout the "newValue" to an Oled. I don't have BS installed, so the string probably has more than one char (digit) to display. First char maybe a space. Regards, Vinc
  7. You should add the refreshDisplay() line into the Bios part. sevseg.setNumber(atoi(newValue)); sevseg.refreshDisplay(); Edit: difficult to write to the tiny mobile phone display Regards, Vinc
  8. As the ADI needs a wider display (e.g 1080 by 1080 px) an ESP32 definitively will not have sufficient memory to make it. That's the reason at the time I'm experimenting with Raspberry PI and learning Python. You probably saw the first test shot for the 800x800 graphics of the HSI at Vimeo. https://vimeo.com/VID_20230314_113217.mp4 Regards, Vinc
  9. The third sketch to share is for the Warthog's Accelerometer (G-Meter) and is an example for a three pointers gauge. Same conditions as above (ESP32 dev board and 1.28" round colur display). 16bit RGB565 graphis files have to be saved within the same folder like the sketch. The reset button (Push to Set) may be used if a dedicatd pin is defined. Feel free to play around, adjust and show your results! Graphic files g-meter_scale.h g-load_pointer.h g-limit_pointer.h No pics available yet, feel free to post yours. Regards, Vinc
  10. I also want to share the code for the A-10C Standby ADI for the 1.28" round display. This sketch is written for an ESP32 development board (sources see above posting). The graphics are converted with LCD Image Converter tool into 16bit RGB565. https://lcd-image-converter.riuson.com/en/about/ If you connect a potentiometer or rotary for pitch adjustment, you still have to declare the respective pin. I've tryed to comment as much as possible within the code so you may see what I did and adjust to your needs. Feel free to play around, adjust and show your results! Graphics that have to be saved within the same folder like the Arduino sketch SAI_graphics.h Regards, Vinc
  11. Well it took a while but I want to share another totally reworked script for the Warthog’s digital clock. Code is written for a 240x240 pixel Waveshare 1.28” round SPI LCD module, driven by an ESP32 development board. Display: https://eckstein-shop.de/WaveShare128inchRoundLCDDisplayModule240x2402C65KRGBforArduino2FRaspberryPi?googlede=1&gclid=Cj0KCQjwjvaYBhDlARIsAO8PkE2JqP4jUlS3IvEzCE6XaI9XeNbNOekgpZslHC49gSfubxa_UoYsoJAaAmeOEALw_wcB Or here: https://www.ebay.com/itm/265030625039 ESP32 board 30 pin version: https://joy-it.net/en/products/SBC-NodeMCU-ESP32 ESP32 board 38 pin version: https://www.az-delivery.de/products/esp32-developmentboard or similar https://www.amazon.co.uk/gp/product/B07VJ34N2Q/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1 You further need some libraries for the ESP32: AnalogWrite for the ESP32 if you want to use it with DcsBios: https://www.arduino.cc/reference/en/libraries/esp32-analogwrite/ Bodmer’s TFT_eSPI to draw nice screens: https://github.com/Bodmer/TFT_eSPI I've tryed to comment as much as possible within the code, so you have some explanations what I did and what may be adapted by yourself. The script can be used in demo mode to see the clock’s display and adjust the colours (just uncomment the first line). To save memory the used fonts are within separate files and only include the digits and letters E, C and T. Both files have to be saved within the same folder like the Arduino sketch. Feel free to play around, adjust and show your results! EDIT: you may define the pin setup for the display within the TFT_eSPI library. See above link for a dedicated description. I personally use the following configuration: Setup_GC9A01_ESP32_240x240.h Code for the ESP32 development board Digits DSEG7_Classic_Mini_Bold_45_dc.h Letters Monospaced_plain_32_etc.h Regards, Vinc
  12. Hi radonk, For a single digit try the following code //Display bottom line airfield/fixed/target/correction point void onPviLine2PointChange(char* newValue) { sevseg.setNumber(newValue); } DcsBios::StringBuffer<1> pviLine2PointBuffer(0x1932, onPviLine2PointChange); In case chars are not allowed, you have to convert the "newValue" into an integer -> atoi(newValue) //Display bottom line airfield/fixed/target/correction point void onPviLine2PointChange(char* newValue) { sevseg.setNumber(atoi(newValue)); } DcsBios::StringBuffer<1> pviLine2PointBuffer(0x1932, onPviLine2PointChange); Regards, Vinc
  13. I have another issue to tell. Using the "old" version of DcsBios (not that one from Flightpanel) and it is since the last update of DCS only working good with the Bf-109 module. Starting a flight in the A-10C II gives neither response to the DcsBios control reference nor anything to the Arduinos. Strange behavior and until now I have no clue why it isn't so with the 109 module. Same behavior is at my Flight rig and at the laptop. So I'll probably have to wait for the next update and if that doesn't fix it do a complete reinstallation of DCS and Bios. Regards, Vinc @byteman59 That hardcopy is an excellent image source.
  14. Yesssss, servos or X27 type steppers are easy to use with simple gauges. You may use a Nano per instrument, connected to the DcsBios RS485 bus to save USB ports. You even need no driver boards for the little steppers and cheap servos. Round colour TFTs look better for complex gauges like the digital clock or the G-Meter (3 pointers). I even made an ESP32 driven StbyASI display. Unfortunately I didn't manage to connect any ESP32 to the DcsBios RS485 bus yet. So every dev board blocks an USB port for now. Regards, Vinc
  15. For the wiring have a look at the graphics in the first page of this topic. https://forum.dcs.world/topic/208455-dcs-bios-over-rs485/?do=findComment&comment=3926198 TX (transmit to the bus)-> DI (driver in) RX (receive from bus)-> RO (receiver out) D2 -> DE (driver enable) and RE (receiver enable) Regards, Vinc
  16. Try to use TX1 (pin 18) and RX1 (pin 19) at the Master. Regards, Vinc
  17. Looks great! Did you use the Bodmer's TFT_eSPI library? Regards, Vinc
  18. Hi Johan, I already explained that at the previous page. You may declare an offset variable and use it in the mapping function. int offset = 12; stepper0.runToNewPosition(map(newValue, 0, 65535, 0+offset, 290+offset)); // for the km disk in FULL4WIRE mode If the name "offset" already is in use, you have to choose a different name. Nevertheless you have to zero the stepper (not the disk) each time after booting the Arduino. Regards, Vinc
  19. Hi Johan, going to the end stops should be the normal calibration procedure for that kind of stepper motors. I think that they already are designed to that. https://www.yumpu.com/fr/document/view/19008880/vid29-power-on-reset-procedure-guy-carpenter You may go back to the lower stop only by turning just from the 13 km mark to the stop and back to the offset. You also may use the offset not in the calibration procedure but in the mapping function. Than you should not have the problem of adding offsets for each reset. Regards, Vinc
  20. Hi Les, I think the difference is, that a Vid60 has builtin zero detection and a second needle pin. Although I believe that second axle is reduced 12:1 for clock applications. https://www.ecplaza.net/products/vid60-02-zero-detection-car-clock_2714715 https://m.de.aliexpress.com/i/32355222935.html?gatewayAdapt=gloPc2deuMsite Regards, Vinc
  21. Hi Johan, why don't you use the full range of the km disk stepper during calibration (630 steps)? Imagine, if your disk has moved more than 460 steps away from the lower stop (already should be the case for adding the offset to the 460 steps), it will only go 460 steps back to zero itself and than to the offset to set a new zero. In that case you don't have the zero mark at 0 step position after the next calibration cycle. Try to start the arduino for several times and wait for the zero function for stepper0. At least it should add 12 steps for each calibration circle to the zero mark. The jumps around the zero position of the needle stepper may be caused by the disk's IR sensor detectable slot width. A smaller slot should reduce the jumps. As long as that jumps only are while zeroing the pressure and not when flying (going through the zero position), I wouldn't care about it. Regards, Vinc
  22. Yes, here is a link to the demo clip. Regards, Vinc https://youtu.be/OWH_POw2a64
  23. Hi Johan, as you did not have physically manipulated the inner stops of the stepper motor, you have to stay with 630 full steps between both stops (315°). Otherwise there is no correct calibration possible. The above change in the map function should be okay but may need an offset (0+offset to 290+offset). Before that the offset has to be declared as an int variable! int offset = 20; // let's assume that the offset should be 20 steps An other solution is to change the zero_stepper0() function to run the stepper against the lower end stop and back to the zero mark of the scale (offset). Than setCurrentPosition(0). Should be read something like that (untested): stepper0.runToNewPosition(630); // go to the upper end stop delay(250); stepper0.setCurrentPosition(630); // set max steps stepper0.runToNewPosition(0); // go to the lower end stop delay(250); stepper0.runToNewPosition(offset); // go to the zero mark of the km disk delay(250); stepper0.setCurrentPosition(0); // set steps to new zero How far away is the zero marking of the disk from the lower end stop? Regards, Vinc
  24. Hi Johan, you made a mistake while calibrating the gauge by editing the map function. As somwhere explained here, that function works like map(newValue, Dcs value min, Dcs value max, your stepper min, your stepper max); So the newValue is the actual value supplied from DcsBios. Dcs value min and max can be read out from the respective control reference. For a standard (unsigned) integer value that is the range from 0 to 65535 and cannot be changed by you. The your stepper min and max values are the steps your motor has to go from scale minimum to maximum (e.g. 0 to 13 km). Unfortunately the data sheet says that the X25 and X27 stepper have 3 steps per degree, but the AccelStepper library seems to use only 2 steps per degree in full step mode (FULL4WIRE) and 4 steps in half step mode (HALF4WIRE). As your km disk uses a stepper with end stop it has a maximum of 1260 half steps or 630 in full step mode (equals 315 degrees). If you are in full step mode and want to turn the motor only 225 degrees you may use 450 steps as the maximum to be mapped (equals 900 in half step mode). The correct function than must be read stepper0.runToNewPosition(map(newValue, 0, 65535, 0, 450)); // for the km disk in FULL4WIRE mode The stepper motor for the needle ist set to 0 steps at the IR sensor and to maxSteps at 1000 meter. For a full turn the stepper has to go 1440 half steps or 720 in full step mode, while zero already is the first step (equals 360 degrees; maxSteps - 1). The correct functions therefore must be read as follows return map(newValue, 0, 65535, 0, stepperConfig.maxSteps-1); // for the 1000m needle To declare the maxSteps you have to enter your values into the stepperConfig declaration (720 in full step mode) /* modify below this line */ /* define stepper parameters multiple Vid60Stepper instances can share the same StepperConfig object */ struct StepperConfig stepperConfig = { 720, // maxSteps 8000, // acceleration 4000 // maxSpeed }; For you information, see here for error within the stepperConfig, I already corrected above. If you don't use pin 13 anymore, you may delete the respective line pinMode(13, OUTPUT); As 450 steps may be the end of your km disk, it is not the position of the stepper's end stop. You therefore have to use the maximum steps for that motor to calibrate at the startup (go to the upper stop). In full step mode the function to zero the km disk must read void zero_stepper0(){ stepper0.setMaxSpeed(4000); // maximum speed in steps per second. Must be > 0. stepper0.setAcceleration(8000); // desired acceleration in steps per second per second. Must be > 0.0 stepper0.runToNewPosition(630); // go to the upper end stop delay(250); stepper0.setCurrentPosition(630); // set max steps stepper0.runToNewPosition(0); // go to the lower end stop delay(250); stepper0.setCurrentPosition(0); // set steps to zero } I attached a modified file, including the above corrections. Regards, Vinc Alititude_Gauge_mod.ino
  25. Hi outbaxx, according to the structure definition I think you are right Regards, Vinc
×
×
  • Create New...