Jump to content

Vuacheslav

Members
  • Posts

    16
  • Joined

  • Last visited

About Vuacheslav

  • Birthday 11/01/1981

Personal Information

  • Flight Simulators
    DCS, Microsoft Flight Simulator
  • Location
    Ukraine Kiev
  • Interests
    Electronics, diving, flying, simulators, cockpit building

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Cool project. Do you have models to make? I want to make these panels
  2. Guys tell me how to make the backlight of the scale in the device? I can’t find the item for which the backlight is responsible (what to look for?), and which pins to connect the LEDs to?
  3. I tried with these parameters, but it turns out that the arrow shows less than on the screen here is my code #define DCSBIOS_IRQ_SERIAL #include <AccelStepper.h> #include "DcsBios.h" struct StepperConfig { unsigned int maxSteps; unsigned int acceleration; unsigned int maxSpeed; }; class Vid29Stepper : public DcsBios::Int16Buffer { private: AccelStepper& stepper; StepperConfig& stepperConfig; unsigned int (*map_function)(unsigned int); unsigned char initState; public: Vid29Stepper(unsigned int address, AccelStepper& stepper, StepperConfig& stepperConfig, unsigned int (*map_function)(unsigned int)) : Int16Buffer(address), stepper(stepper), stepperConfig(stepperConfig), map_function(map_function), initState(0) { } virtual void loop() { if (initState == 0) { // not initialized yet stepper.setMaxSpeed(stepperConfig.maxSpeed); stepper.setAcceleration(stepperConfig.acceleration); stepper.moveTo(-((long)stepperConfig.maxSteps)); initState = 1; } if (initState == 1) { // zeroing stepper.run(); if (stepper.currentPosition() <= -((long)stepperConfig.maxSteps)) { stepper.setCurrentPosition(0); initState = 2; stepper.moveTo(stepperConfig.maxSteps); } } if (initState == 2) { // running normally if (hasUpdatedData()) { unsigned int newPosition = map_function(getData()); newPosition = constrain(newPosition, 0, stepperConfig.maxSteps); stepper.moveTo(newPosition); } stepper.run(); } } }; struct StepperConfig stepperConfig = { 5760, // maxSteps 1000, // maxSpeed 1000 // acceleration }; AccelStepper stepper(AccelStepper::DRIVER, 11, 10); Vid29Stepper airspeedNeedleBuffer(0x5030, stepper, stepperConfig, [](unsigned int newValue) -> unsigned int { return map(newValue, 0, 65535, 0, stepperConfig.maxSteps); }); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); }
  4. Thanks guys for the clarification. It seems that I figured it out with the arrow. According to this program, the arrow moves evenly (up to 250 it works correctly). but since after 300, the divisions go by 100 on the device, the readings do not correspond to those on the screen. How to prescribe so that after 250 it goes to hundreds?
  5. swapped the coils, now the direction is correct, but the deviation of the arrow does not correspond to the deviation on the screen
  6. I tried this program, but the following problem appeared, the arrow moves in the other direction (in reverse), how to fix it?
  7. it transmits real speed values maximum speed values 700 I understand that the program should look like this? #define DCSBIOS_IRQ_SERIAL #include <AccelStepper.h> #include "DcsBios.h" struct StepperConfig { unsigned int maxSteps; unsigned int acceleration; unsigned int maxSpeed; }; class Vid29Stepper : public DcsBios::Int16Buffer { private: AccelStepper& stepper; StepperConfig& stepperConfig; unsigned int (*map_function)(unsigned int); unsigned char initState; public: Vid29Stepper(unsigned int address, AccelStepper& stepper, StepperConfig& stepperConfig, unsigned int (*map_function)(unsigned int)) : Int16Buffer(address), stepper(stepper), stepperConfig(stepperConfig), map_function(map_function), initState(0) { } virtual void loop() { if (initState == 0) { // not initialized yet stepper.setMaxSpeed(stepperConfig.maxSpeed); stepper.setAcceleration(stepperConfig.acceleration); stepper.moveTo(-((long)stepperConfig.maxSteps)); initState = 1; } if (initState == 1) { // zeroing stepper.run(); if (stepper.currentPosition() <= -((long)stepperConfig.maxSteps)) { stepper.setCurrentPosition(0); initState = 2; stepper.moveTo(stepperConfig.maxSteps/2); } } if (initState == 2) { // running normally if (hasUpdatedData()) { unsigned int newPosition = map_function(getData()); newPosition = constrain(newPosition, 0, stepperConfig.maxSteps); stepper.moveTo(newPosition); } stepper.run(); } } }; struct StepperConfig stepperConfig = { 3900, // maxSteps 1000, // maxSpeed 1000 // acceleration }; AccelStepper stepper(AccelStepper::DRIVER, 11, 10); Vid29Stepper airspeedMphValueBuffer(0x5098, stepper, stepperConfig, [](unsigned int newValue) -> unsigned int { return map(newValue, 0, 700, 0, stepperConfig.maxSteps); }); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); }
  8. how can I find out?, I can't tell what it returns
  9. Thanks for the answer. I did everything as you said, but in the simulator itself the arrow does not respond to speed changes. Initialization passes (when turned on, the arrow deviates to the left and then to the right) I checked the connection, everything is correct.
  10. But what about connecting the electronic part then?, I use a nano + stepper motor controller + x27.168, I have 2 contacts step and dir, how then to connect them? only the signal wire is connected to the servo (and here is the step and direction)
  11. Thanks for the answer, but I would like to use the x27.168 motor, the servo is not suitable
  12. Guys, I ask for help in writing a sketch for a speed indicator in a Mustang P51D. I can't figure out how to write it. Photo of used equipment. Here are the parameters that the HUB offers void onAirspeedMphValueChange(unsigned int newValue) { /* your code here */ } DcsBios::IntegerBuffer airspeedMphValueBuffer(0x5098, 0xffff, 0, onAirspeedMphValueChange); what should i do with it?
×
×
  • Create New...