

lesthegrngo
Members-
Posts
1245 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by lesthegrngo
-
'Coolie' hat 4 way switch for A10 Emergency flight panel
lesthegrngo replied to lesthegrngo's topic in Home Cockpits
youch on the price of the PC flights switch! Thanks though, much appreciated - I'll have a look at the printed version Les -
'Coolie' hat 4 way switch for A10 Emergency flight panel
lesthegrngo posted a topic in Home Cockpits
I need to find a small four / eight way hat type switch to complete the A10 emergency flight control panel, as it uses one for the Emergency Trim switch. I've looked at Ebay, but maybe my search terms are not suitable because I only ever come across 4 way rotary switches or large joystick types, and the small 'joystick' switches are analogue (presumably potentiometers) rather than digital I thought about cannibalising one of my son's old Playstation or XBox controllers but suspect that they are fixed into a PBC that would render them difficult if not impossible to use. They must exist, does anyone have any guidance on what to search as or where I could get one? Cheers Les -
A couple of questions - what aircraft (I always forget to say, assuming everyone already knows!) Also, are you using a stepper that has a limited travel? I believe those 360 VID motors have an inbuilt 0 position sensor but am not certain, never having found one for sale Les
-
Yes, that's why it's so puzzling. You can literally run the one mod with the device connected and running fine, then simply change the module without changing anything else or exiting the game, and it just doesn't work. Most run fine, just the occasional one that doesn't. It isn't even consistent with a particular sketch, Vinc has the standby compass working for both mods, yet my installation refuses to play along. That's what makes me believe it's something to do with my installation
-
Yes, the one here https://github.com/DCSFlightpanels/dcs-bios Vinc made a sketch for the Standby Compass using an ESP32 board, it works great in A10C but not at all in A10C2 Les
-
ok, thanks - the question was related to the fact that I still have some sketches that work with the A10C but not with the A10C2 mods, so wondered if it was due to some scrap code somewhere in the PC being read when it shouldn't be. Vinc has also reported similar issues to me, but I'm reluctant to report it as a bug when it may be due to PC specific issues Cheers Les
-
Code needed for Viper FFI Using SH1106 1.3" 128x64 IIC
lesthegrngo replied to Enabler's topic in Home Cockpits
try changing #define DCSBIOS_DEFAULT_SERIAL //#define DCSBIOS_IRQ_SERIAL to //#define DCSBIOS_DEFAULT_SERIAL #define DCSBIOS_IRQ_SERIAL- 26 replies
-
- oled
- arduino code
-
(and 2 more)
Tagged with:
-
Code needed for Viper FFI Using SH1106 1.3" 128x64 IIC
lesthegrngo replied to Enabler's topic in Home Cockpits
try this with a smaller text #define DCSBIOS_DEFAULT_SERIAL //#define DCSBIOS_IRQ_SERIAL //#define DCSBIOS_RS485_SLAVE 51 //#define TXENABLE_PIN 2 #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SH1106.h> #include "Fonts/FreeSans18pt7b.h" #define OLED_RESET 4 Adafruit_SH1106 display(OLED_RESET); #include <DcsBios.h> void setup() { display.begin(SH1106_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64) delay(1000); display.clearDisplay(); // clears the screen and buffer display.setFont(&FreeSans24pt7b); DcsBios::setup(); } void loop() { DcsBios::loop(); } void onFuelflowcounter100Change(unsigned int newValue) { display.fillRect(0, 0, 128, 60, BLACK); // Draws a blank rectangle to clear the previous text display.setTextColor(WHITE, BLACK); display.setCursor(45, 50); display.print(newValue); display.display(); } DcsBios::IntegerBuffer fuelflowcounter100Buffer(0x44e8, 0xffff, 0, onFuelflowcounter100Change); void onFuelflowcounter1kChange(unsigned int newValue) { display.setTextColor(WHITE, BLACK); display.setCursor(30, 50); display.print(newValue); display.display(); } DcsBios::IntegerBuffer fuelflowcounter1kBuffer(0x44e6, 0xffff, 0, onFuelflowcounter1kChange); void onFuelflowcounter10kChange(unsigned int newValue) { display.setTextColor(WHITE, BLACK); display.setCursor(15, 50); display.print(newValue); display.display(); } DcsBios::IntegerBuffer fuelflowcounter10kBuffer(0x44e4, 0xffff, 0, onFuelflowcounter10kChange); we can look at the mapping when we get the text size right- 26 replies
-
- oled
- arduino code
-
(and 2 more)
Tagged with:
-
Code needed for Viper FFI Using SH1106 1.3" 128x64 IIC
lesthegrngo replied to Enabler's topic in Home Cockpits
The section of each callout like this "display.setCursor(30, 50);" sets where the text is displayed, basically horizontal and vertical position, try playing with that to make all the text display It may be that the numbers will need to be mapped Les- 26 replies
-
- oled
- arduino code
-
(and 2 more)
Tagged with:
-
Code needed for Viper FFI Using SH1106 1.3" 128x64 IIC
lesthegrngo replied to Enabler's topic in Home Cockpits
so the numbers are not correct? Try this, send a picture if you can #define DCSBIOS_DEFAULT_SERIAL //#define DCSBIOS_IRQ_SERIAL //#define DCSBIOS_RS485_SLAVE 51 //#define TXENABLE_PIN 2 #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SH1106.h> #include "Fonts/FreeSans24pt7b.h" #define OLED_RESET 4 Adafruit_SH1106 display(OLED_RESET); #include <DcsBios.h> void setup() { display.begin(SH1106_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64) delay(1000); display.clearDisplay(); // clears the screen and buffer display.setFont(&FreeSans24pt7b); DcsBios::setup(); } void loop() { DcsBios::loop(); } void onFuelflowcounter100Change(unsigned int newValue) { display.fillRect(0, 0, 128, 60, BLACK); // Draws a blank rectangle to clear the previous text display.setTextColor(WHITE, BLACK); display.setCursor(45, 50); display.print(newValue); display.display(); } DcsBios::IntegerBuffer fuelflowcounter100Buffer(0x44e8, 0xffff, 0, onFuelflowcounter100Change); void onFuelflowcounter1kChange(unsigned int newValue) { display.setTextColor(WHITE, BLACK); display.setCursor(30, 50); display.print(newValue); display.display(); } DcsBios::IntegerBuffer fuelflowcounter1kBuffer(0x44e6, 0xffff, 0, onFuelflowcounter1kChange); void onFuelflowcounter10kChange(unsigned int newValue) { display.setTextColor(WHITE, BLACK); display.setCursor(15, 50); display.print(newValue); display.display(); } DcsBios::IntegerBuffer fuelflowcounter10kBuffer(0x44e4, 0xffff, 0, onFuelflowcounter10kChange);- 26 replies
-
- oled
- arduino code
-
(and 2 more)
Tagged with:
-
Interesting - so does that mean that if there is a legacy installation somewhere it might still use it even if you have another correct one?
-
Code needed for Viper FFI Using SH1106 1.3" 128x64 IIC
lesthegrngo replied to Enabler's topic in Home Cockpits
The characters were all trying to print on the same part of the screen, plus you only need one instance of the screen clearing rectangle try this #define DCSBIOS_DEFAULT_SERIAL //#define DCSBIOS_IRQ_SERIAL //#define DCSBIOS_RS485_SLAVE 51 //#define TXENABLE_PIN 2 #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SH1106.h> #include "Fonts/FreeSans24pt7b.h" #define OLED_RESET 4 Adafruit_SH1106 display(OLED_RESET); #include <DcsBios.h> void setup() { display.begin(SH1106_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64) delay(1000); display.clearDisplay(); // clears the screen and buffer display.setFont(&FreeSans24pt7b); DcsBios::setup(); } void loop() { DcsBios::loop(); } void onFuelflowcounter100Change(unsigned int newValue) { display.fillRect(0, 0, 128, 60, BLACK); // Draws a blank rectangle to clear the previous text display.setTextColor(WHITE, BLACK); display.setCursor(15, 50); display.print(newValue); display.display(); } DcsBios::IntegerBuffer fuelflowcounter100Buffer(0x44e8, 0xffff, 0, onFuelflowcounter100Change); void onFuelflowcounter1kChange(unsigned int newValue) { display.setTextColor(WHITE, BLACK); display.setCursor(30, 50); display.print(newValue); display.display(); } DcsBios::IntegerBuffer fuelflowcounter1kBuffer(0x44e6, 0xffff, 0, onFuelflowcounter1kChange); void onFuelflowcounter10kChange(unsigned int newValue) { display.setTextColor(WHITE, BLACK); display.setCursor(45, 50); display.print(newValue); display.display(); } DcsBios::IntegerBuffer fuelflowcounter10kBuffer(0x44e4, 0xffff, 0, onFuelflowcounter10kChange);- 26 replies
-
- oled
- arduino code
-
(and 2 more)
Tagged with:
-
Code needed for Viper FFI Using SH1106 1.3" 128x64 IIC
lesthegrngo replied to Enabler's topic in Home Cockpits
try this, replace the A10 part like this void onTacanChannelChange(char* newValue) { display.fillRect(0, 0, 128, 60, BLACK); // Draws a blank rectangle to clear the previous text display.setTextColor(WHITE, BLACK); display.setCursor(14, 50); display.print(newValue); display.display(); } DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange); with your code #define DCSBIOS_DEFAULT_SERIAL //#define DCSBIOS_IRQ_SERIAL //#define DCSBIOS_RS485_SLAVE 51 //#define TXENABLE_PIN 2 #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SH1106.h> #include "Fonts/FreeSans24pt7b.h" #define OLED_RESET 4 Adafruit_SH1106 display(OLED_RESET); #include <DcsBios.h> void setup() { display.begin(SH1106_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64) delay(1000); display.clearDisplay(); // clears the screen and buffer display.setFont(&FreeSans24pt7b); DcsBios::setup(); } void loop() { DcsBios::loop(); } void onTacanChannelChange(char* newValue) { display.fillRect(0, 0, 128, 60, BLACK); // Draws a blank rectangle to clear the previous text display.setTextColor(WHITE, BLACK); display.setCursor(14, 50); display.print(newValue); display.display(); } DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange);- 26 replies
-
- oled
- arduino code
-
(and 2 more)
Tagged with:
-
All, I have just spent a 'fun' couple of hours diagnosing some weird issues with the TACAN mode selector switch, where I found that the behaviour of the switch in game did not match the actual input. I was using the script from the newer DSC Bios documentation, and it was all over the place. After checking and rechecking all the diagrams, the PCB for shorts or duff circuits, I decided to check the old DCS version to see if it was different, and it is. I loaded the old one on the nano in place of the new, and it works perfectly So, if you are having issues with the TACAN mode selector, try using the old version to see if it helps you, I've copied both out below New DCS Bios script const byte tacanModePins[9] = {PIN_0, PIN_1, PIN_2, PIN_3, PIN_4} DcsBios::SwitchMultiPos tacanMode("TACAN_MODE", tacanModePins, 9); Old DSC Bios script const byte tacanModePins[5] = {PIN_0, PIN_1, PIN_2, PIN_3, PIN_4}; DcsBios::SwitchMultiPos tacanMode("TACAN_MODE", tacanModePins, 5); Cheers Les
-
Some of the more esoteric OLED display boards can require particular coding to work that is similar to but not quite the same as the standard SSD1306 versions This is for a 1.3 inch SH1106 128 x 64 I2C OLED (in this case for the TACAN), please note that the input pin order is different to the usual in that the VCC and GND pins are transposed #define DCSBIOS_DEFAULT_SERIAL //#define DCSBIOS_IRQ_SERIAL //#define DCSBIOS_RS485_SLAVE 51 //#define TXENABLE_PIN 2 #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SH1106.h> #include "Fonts/FreeSans24pt7b.h" #define OLED_RESET 4 Adafruit_SH1106 display(OLED_RESET); #include <DcsBios.h> DcsBios::LED tacanTest(0x10da, 0x0400, 11); DcsBios::ActionButton tacanTestBtnToggle("TACAN_TEST_BTN", "TOGGLE", 12); DcsBios::RotaryEncoder tacan1("TACAN_1", "DEC", "INC", 3, 4); DcsBios::RotaryEncoder tacan10("TACAN_10", "DEC", "INC", 5, 6); DcsBios::RotaryEncoder tacanXy("TACAN_XY", "DEC", "INC", 7, 8); DcsBios::RotaryEncoder tacanVol("TACAN_VOL", "-3200", "+3200", 9, 10); void setup() { display.begin(SH1106_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3D (for the 128x64) delay(1000); display.clearDisplay(); // clears the screen and buffer display.setFont(&FreeSans24pt7b); DcsBios::setup(); } void loop() { DcsBios::loop(); } void onTacanChannelChange(char* newValue) { display.setRotation(2); // Sets the rotation of the screen, set to 0 for normal display.fillRect(0, 0, 100, 50, BLACK); // Draws a blank rectangle to clear the previous text display.setTextColor(WHITE, BLACK); display.setCursor(8, 40); display.print(newValue); display.display(); } DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange); This one is for an SSD1305 128 x 32 OLED (in this case used for the ILS display) note that it is a seven pin connection type and you will have to make sure you adjust the CLK, MOSI, CS, DS and RESET pins accordingly, and also unlike some OLED displays I found that the RESET pin does have to be connected #define DCSBIOS_IRQ_SERIAL //#define DCSBIOS_RS485_SLAVE 75 //#define TXENABLE_PIN 2 #include <DcsBios.h> #include <Wire.h> #include <SPI.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1305.h> #include "Fonts/FreeSans18pt7b.h" // Used for software SPI #define OLED_CLK 13 #define OLED_MOSI 11 // Used for software or hardware SPI #define OLED_CS 8 #define OLED_DC 9 // Used for I2C or SPI #define OLED_RESET 10 Adafruit_SSD1305 display(128, 32, &SPI, OLED_DC, OLED_RESET, OLED_CS, 6000000UL); void setup() { { display.begin(0x3C); delay(1000); display.clearDisplay(); // clears the screen and buffer display.setFont(&FreeSans18pt7b); } DcsBios::setup(); } DcsBios::RotaryEncoder ilsVol("ILS_VOL", "-3200", "+3200", 16, 17); DcsBios::RotaryEncoder ilsKhz("ILS_KHZ", "DEC", "INC", 18, 19); DcsBios::RotaryEncoder ilsMhz("ILS_MHZ", "DEC", "INC", 15, 14); void loop() { DcsBios::loop(); display.display(); display.setTextColor(WHITE, BLACK); // Draws a blank rectangle to clear the previous text display.setCursor(66, 27); display.print("."); display.display(); } void onIlsMhzChange(char* newValue) { display.fillRect(0, 0, 65, 32, BLACK); // Draws a blank rectangle to clear the previous text display.setTextColor(WHITE, BLACK); display.setCursor(8, 27); display.print(newValue); display.display(); } DcsBios::StringBuffer<3> ilsMhzStrBuffer(0x116e, onIlsMhzChange); void onIlsKhzChange(char* newValue) { display.fillRect(75, 0, 50, 32, BLACK); display.setTextColor(WHITE, BLACK); display.setCursor(75, 27); display.print(newValue); display.display(); } DcsBios::StringBuffer<2> ilsKhzStrBuffer(0x1172, onIlsKhzChange); Hope this helps Les
- 75 replies
-
- 1
-
-
Hi all, a new day and a new issue. I actually resolved this and another related issue so thought I would post it here. It involved another foray into the Arduino 'Help' forum (why do I keep doing that to myself?) which while it didn't resolve the issue was good for learning a few things. Not least that I shouldn't try to go on that forum to ask for help.... This time it seemed to be with the SAS and the Environmental panel. Firstly the SAS panel, and that in theory should have been a simple one. With the custom PCB I made something was going on with the "YAW SAS L" and YAW SAS R" where toggling one will make the other turn off. The same was happening with the two "PITCH SAS" switches. To test it to see if this was an issue with my PCB I direct wired a couple of toggle switches to the Nano, in this case pins 16 and 19 for the SAS pitch R and 17 and 18 for the SAS pitch L This is the code #define DCSBIOS_DEFAULT_SERIAL #include <Wire.h> #include <DcsBios.h> DcsBios::Switch2Pos saspToTrim("SASP_TO_TRIM", 8); DcsBios::LED takeOffTrim(0x1026, 0x0400, 7); DcsBios::RotaryEncoder saspYawTrim("SASP_YAW_TRIM", "-3200", "+3200", 11, 10); const byte saspPitchSasLPins[3] = {17, 18}; DcsBios::SwitchMultiPos saspPitchSasL("SASP_PITCH_SAS_L", saspPitchSasLPins, 3); const byte saspPitchSasRPins[3] = {16, 19}; DcsBios::SwitchMultiPos saspPitchSasR("SASP_PITCH_SAS_R", saspPitchSasRPins, 3); const byte saspYawSasLPins[3] = {14, 9}; DcsBios::SwitchMultiPos saspYawSasL("SASP_YAW_SAS_L", saspYawSasLPins, 3); const byte saspYawSasRPins[3] = {13, 15}; DcsBios::SwitchMultiPos saspYawSasR("SASP_YAW_SAS_R", saspYawSasRPins, 3); DcsBios::Switch3Pos saspMonitorTest("SASP_MONITOR_TEST", 5, 6); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } SAS panel PCB schematicdxf.pdf Well, it seems that for the SAS panel at least, choosing switches connected by the analog pins is not a good idea. For some reason, maybe similarities in the callouts, there is crosstalk between them, so the L switch was operating the R switch at the same time. As a result I tried connecting them via the digital pins, and that resolved the issue. A new PCB with the switches connected to the Digital pins (with the exception of the 'monitorTest' switch) was made and that completely resolved the issue. The crosstalk was repeatable using directly wired switches to other nanos so I know it to be some kind of incompatibility with those functions. Curiously the monitorTest can't be made to function but I believe that it has no in game function so I am not fussed. Curious, but not fussed. As for the Environmental panel, there are three potentiometers connected to my particular panel. I wired the centre pins of each to an analog pin, originally 17, 18 and 19. The Pots connected to pins 17 and 18 would not work, all they would do was make the in-game devices tremble as you moved the physical one. However when you moved the one connected to pin 19, all three would move simultaneously. I found that if I connected a potentiometer to pin 19, any other potentiometers connected to that Nano would move in concert with it, and the other pots would do nothing. By reconnecting the potentiometer away from pin 19, all would function correctly There are probably logical reasons for the above and probably some suitable coding would help to prevent it, however my solution was to simply modify the connections so that they did work Anyway, I though it would be worth sharing this with you all, as it may help you avoid or at least get around potential issues Cheers Les
-
Perfect, thanks - I should be able to bind that to a controller using Joy2Key Cheers
-
Apologies if this is not in the correct forum, I searched for something a bit more suitable but couldn't find one that seemed to be appropriate I want to be able to move the camera around the cockpit, which Alt-C does to some degree, but there are parts of the cockpit I cannot see because it is behind some feature, for example the throttle levers, or the ejection seat handles. Is there any way to pan the in-cockpit view forwards and back or side to side? Les
-
I followed the instructions on the installation video here and reinstalled DCS Bios to make sure that it was all correct, but it still didn't work However as part of the installation it says to copy the line from the DCS Master export.lua file into the one in the saved games -scripts folder. I noticed that the master version was this line "dofile(lfs.writedir()..[[Scripts\DCS-BIOS\BIOS.lua]])", but in my scripts export.lua was the line "dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\ExportScript.lua]])", and right below it was "BIOS = {}; BIOS.LuaScriptDir = [[C:\Program Files\DCS-BIOS\dcs-lua\]]; BIOS.PluginDir = [[C:\Users\Les\AppData\Roaming/DCS-BIOS/Plugins\]]; if lfs.attributes(BIOS.LuaScriptDir..[[BIOS.lua]]) ~= nil then dofile(BIOS.LuaScriptDir..[[BIOS.lua]]) end --[[DCS-BIOS Automatic Setup]] On the DCS install on my desktop where I try stuff out, I looked at the export.lua file, and neither of those lines were there. Just to see if it made a difference, I backed it up, then deleted those two lines, just inserting the "dofile(lfs.writedir()..[[Scripts\DCS-BIOS\BIOS.lua]])", version from the BIOS Master folder. And I'm happy to say that not only does it now work with the A10CII mod, it also now allows the Oxy test switch and the Inverter Test switch positions to be recognised, so those sketches work perfectly now. I don't know where those lines came from, but they obviously were causing issues. I'd got to the point where I was going to uninstall everything and do a clean install but looks like for the time being at least that won't be necessary Les
-
All, I bought and installed the A10CII mod today, just to see if the behaviour of the switches that don't seem to work with the A10C mod work differently. The answer is a big 'YES' but not in the way I hoped. DCS Bios does not seem to work at all with the A10CII mod, I can't get anything to work. If I switch back to the A10C without disconnecting the Arduino it instantly is recognised by DCS, and the RX light flashes and I can move switches in game. If I then exit the A10C and go back to the A10CII, no RX light, nothing. I have installed the latest DCS Bios, and when I open the plugins and check for updates, only the A10C shows up, there is no A10CII, although maybe that's correct The DCS Bios should work with the A10CII, right? is there a separate control reference for it, or something I have failed to install? Les
-
Thanks for this - I was so sure that this was going to resolve it, as it was clearly different between the two bits of code. Unfortunately not, neither with the DcsBios::Switch3Pos oxyEmergency("OXY_EMERGENCY", 2, 3); command Curiously I can bind the test position to a joystick button so it is not disabled, merely not set up to work with the DCS Bios output I'll keep looking, but I also found that the inverter test position DCS Bios script doesn't work either where I think it used to. I'm starting to wonder if was using a Bodnar board when I first made these panels, which is why I think they used to work Les