Hey Les!
I dont know whether they would be way different. But i would appreciate if you could share yours. Maybe from there we can work it out to a functional panel.
I tried with John Hall example and tried to modify it. But the motor did 3x loops and desperately tried to do 315 degrees.... So no logic behind the actual gauge in the game
#define DCSBIOS_IRQ_SERIAL
#include <MotorVID28.h>
#include "DcsBios.h"
int smDirectionPin = 8; //Direction pin
int smStepPin = 9; //Stepper pin
int TotalSteps = 180;
MotorVID28 motor1(20*4, 6,7,8,9);
void onFuelQtyLChange(unsigned int newValue) { //the value we get from "onFuelQtyLChange" is placed in the variable "newValue" for us to use.
motor1.setPosition(map(newValue, 0, 65000, 0, TotalSteps)); //Here is where we are remapping the 475 steps to the total steps that are being exported.
}
DcsBios::IntegerBuffer fuelQtyLBuffer(0x10ca, 0xffff, 0, onFuelQtyLChange);
void setup(){
/*Sets all pin to output; the microcontroller will send them(the pins) bits, it will not expect to receive any bits from thiese pins.*/
pinMode(smDirectionPin, OUTPUT);
pinMode(smStepPin, OUTPUT);
DcsBios::setup();
}
void loop() {
DcsBios::loop();
motor1.update();
}