

No1sonuk
Members-
Posts
1594 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by No1sonuk
-
Mine is a clone, too.
-
Did you set the right board for the nano in the Arduino IDE? Mine was also an Uno, but I just tried a Nano and got the same, working result.
-
1 step means it doesn't need the different code line. Also, having looked at your image earlier, I don't think the encoder IS sending data. Mine has "ALT_PRESS_SET -3200" and "ALT_PRESS_SET +3200" in the text. This is after starting the connection, without DCS open: My code: /* 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 #include "DcsBios.h" /* paste code snippets from the reference documentation here */ DcsBios::RotaryEncoder altPressSet("ALT_PRESS_SET", "-3200", "+3200", 2,3); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); }
-
The data on the web site indicates it's one pulse/step per detent.
-
I think I know the problem - I left some LED driver code in there. Sorry. Try this: #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,20,2); // set the LCD address to 0x27 for a 20 chars and 2 line display // ***************** DCS-BIOS ****************** void onCmsp1Change(char* newValue) { lcd.setCursor(0,0); lcd.print(newValue); } DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change); void onCmsp2Change(char* newValue) { lcd.setCursor(0,1); lcd.print(newValue); } DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change); // *************************************************************** void setup() { DcsBios::setup(); lcd.init(); // initialize the lcd lcd.backlight(); lcd.setCursor(0,0); // column, row } void loop() { DcsBios::loop(); } I added the LiquidCrystal I2C library to a fresh install that had just the DCS-BIOS library added, and this compiles OK.
-
Try smaller, or larger, numbers in the steps in case it's over, or under-driving the control.
-
This is cobbled together from some code I wrote for a radio display on a 20x4 LCD, modified for CMSP on 20x2. You'll need the Wire and LiquidCrystal I2C ( https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library ) libraries. I think the Wire library is built into the Arduino IDE. #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,20,2); // set the LCD address to 0x27 for a 20 chars and 2 line display // ***************** DCS-BIOS ****************** void onCmsp1Change(char* newValue) { lcd.setCursor(0,0); lcd.print(newValue); } DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change); void onCmsp2Change(char* newValue) { lcd.setCursor(0,1); lcd.print(newValue); } DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change); // *************************************************************** void setup() { DcsBios::setup(); lcd.init(); // initialize the lcd lcd.backlight(); lcd.setCursor(0,0); // column, row /* The Library needs to initialize hardware */ lc.begin(); for (byte i = 0; i < LED_MODULES; i++) { lc.shutdown(i, false); /* Set the brightness to a medium value, possible is 0-15 */ lc.setIntensity(i, 8); } /* and clear all displays */ lc.clearDisplay(); } void loop() { DcsBios::loop(); } I've NOT tested it, so I don't know if it works. If it doesn't, I can give you my 20x4 radio display code I know does work.
-
V0.10.0 is the "HUB" version of DCS-BIOS and is no longer supported. You should switch to the "Flightpanels fork" which, despite having lower version numbers, is actually up to date and actively maintained. Have you tried a program with just the one servo and nothing else? Also, which Arduino are you using?
-
Those lines call a code function. The top one calls "onCmsp1Change". You then write that function to do what you need with the data. There was a second block of code with each of those lines in the control reference that had the empty function.
-
That should work. Is the DCS-BIOS up to date? Which version are you using? Also, are the servo time numbers within the correct range for your servo? I notice they're both the same, so you've not calibrated it yet.
-
Looking at this thread, it seems to me you're coming up against the same problem as I had with the P-51 airspeed indicator - A linear output from DCS and a non-linear gauge needle position. I found this code in the mainpanel_init.lua of the P-51, but didn't understand why it was showing linear in and out: AirspeedNeedle = CreateGauge() AirspeedNeedle.arg_number = 11 AirspeedNeedle.input = {0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700} AirspeedNeedle.output = {0.0, 0.05, 0.10, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7} AirspeedNeedle.controller = controllers.AirspeedNeedle I abandoned trying to fix it at the time as there was no apparent mathematical progression of the needle position, and I didn't know what was going on. If I'd continued with the physical gauge thing, I'd have made a linear scale face. It wasn't until I was looking into modding late last year that I found out what's going on... The output numbers (0.0 to 0.7) refer to the needle ANIMATION position in the cockpit model (frames 0 to 70). i.e. DCS only deals with the linear figures, and any non-linearity in the displayed gauge is a function of the 3D model animation. The needle is "keyframed" to point at the correct numbers on the gauge for each of the stages, and the 3D modelling software works out the frames in between. However, even though I've realised what's going on, I've not looked at a way to fix it in code.
-
What's the code line you're trying?
-
Yup that's what you need. You also might need to modify the stepper motor so that it has no end stops.
-
To use that, you'd need a "flag" connected to the needle, but inside the gauge, that will pass through the gap.
-
What does "connect the Nano interface to Mega" mean? If you use an RS485 network, you can only use a Mega as a master because it has more than one hardware UART. Nanos have only one UART, so the TX0 and RX0 pins are used for USB OR RS485. You can't do both on the same Nano at the same time.
-
You can use the Arduino "map" function. You map the gauge 0-65535 to the full range of the gauge (I don't know the top end number). E.g. speed= map(newValue, 0, 65535, 0, 850); That assumes "speed" is already declared as a global variable, the max speed value is 850 (a guess), and the code is in the function called when the value changes. However, as mentioned above, the speed is available from the common data.
-
Try "Standby Airspeed Indicator". The primary is on the HUD.
-
MFD EXPORT to 5 different aircraft with 2 files
No1sonuk replied to Spuds63's topic in Home Cockpits
It's not a problem. The PC is a new one for gaming, so I don't have a load of shortcuts that it spreads over all of them. -
Should also note that code is written for RS485 connection.
-
MFD EXPORT to 5 different aircraft with 2 files
No1sonuk replied to Spuds63's topic in Home Cockpits
There are no power cables on the monitors. Only the HDMI cables are connected. -
MFD EXPORT to 5 different aircraft with 2 files
No1sonuk replied to Spuds63's topic in Home Cockpits
Yeah. My screens work. I think the recognition might be a function of the adapter, though. Mine seems to think the monitors are there even if they're switched off. -
MFD EXPORT to 5 different aircraft with 2 files
No1sonuk replied to Spuds63's topic in Home Cockpits
Thanks. I have one of those USB to HDMI units for exactly this purpose. If I can run it through a hub, I can eliminate the long HDMI cables. Do you run any DCS-BIOS devices on the same USB hub? -
MFD EXPORT to 5 different aircraft with 2 files
No1sonuk replied to Spuds63's topic in Home Cockpits
So are you running the Startech HDMI adapter through a USB hub? Also, with Helios, you could put other instruments such as the HSI or ADI on the third monitor when running the A-10. -
Really nice in the air. PITA on the ground and in between!
-
IIRC, you can get clip-in prescription lenses.