-
Posts
1775 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by Hansolo
-
Table mounted landing gear selector switch from a Tornado
Hansolo replied to DeadMeat's topic in Home Cockpits
Outstanding work @DeadMeat. Thanks a bunch for solving this for us :thumbup: Much appreciated sir Cheers Hans -
And what happens if you follow Magnatilla's advise; /* 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" #include "U8glib.h" U8GLIB_ST7920_128X64_1X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17 /* paste code snippets from the reference documentation here */ void onUfcOptionDisplay1Change(char* newValue) { u8g.setFont(u8g_font_5x7); //u8g.setFont(u8g_font_5x7); u8g.drawStr( 0, 22, "newValuew from DCS"); } DcsBios::StringBuffer<4> ufcOptionDisplay1Buffer(0x542a, onUfcOptionDisplay1Change); void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.setFont(u8g_font_5x7); //u8g.setFont(u8g_font_5x7); u8g.drawStr( 0, 22, "TEST"); u8g.drawStr( 0, 42, "NOw WORKING"); } void setup() { // u8g.setRot(); u8g.setRot270(); // set SPI backup if required //u8g.setHardwareBackup(u8g_backup_avr_spi); // assign default color value ;if ( u8g.getMode() == U8G_MODE_R3G3B2 ) { u8g.setColorIndex(255); // white } else if ( u8g.getMode() == U8G_MODE_GRAY2BIT ) { u8g.setColorIndex(3); // max intensity } else if ( u8g.getMode() == U8G_MODE_BW ) { u8g.setColorIndex(1); // pixel on } else if ( u8g.getMode() == U8G_MODE_HICOLOR ) { u8g.setHiColorByRGB(255,255,255); } pinMode(8, OUTPUT); DcsBios::setup(); } void loop(void) { // picture loop u8g.firstPage(); do { draw(); } while( u8g.nextPage() ); // rebuild the picture after some delay //delay(50); } DcsBios::loop(); } Cheers Hans
-
I haven't tried this either but you may try this also; /* 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" #include "U8glib.h" U8GLIB_ST7920_128X64_1X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17 /* paste code snippets from the reference documentation here */ void onUfcOptionDisplay1Change(char* newValue) { u8g.setFont(u8g_font_5x7); //u8g.setFont(u8g_font_5x7); u8g.drawStr( 0, 22, newValue); // added drawing the newValue instead of fixed text } DcsBios::StringBuffer<4> ufcOptionDisplay1Buffer(0x542a, onUfcOptionDisplay1Change); void setup() { // u8g.setRot(); u8g.setRot270(); // set SPI backup if required //u8g.setHardwareBackup(u8g_backup_avr_spi); // assign default color value ;if ( u8g.getMode() == U8G_MODE_R3G3B2 ) { u8g.setColorIndex(255); // white } else if ( u8g.getMode() == U8G_MODE_GRAY2BIT ) { u8g.setColorIndex(3); // max intensity } else if ( u8g.getMode() == U8G_MODE_BW ) { u8g.setColorIndex(1); // pixel on } else if ( u8g.getMode() == U8G_MODE_HICOLOR ) { u8g.setHiColorByRGB(255,255,255); } pinMode(8, OUTPUT); DcsBios::setup(); } void loop(void) { DcsBios::loop(); // removed all but DCS-BIOS } It has removed the need for the draw() function and instead should refresh when getting a new value from DCS. At least you can check if it can compile. cheers Hans
-
Table mounted landing gear selector switch from a Tornado
Hansolo replied to DeadMeat's topic in Home Cockpits
My best guess is that the version of the Tornado lever you have ordered have the same weight on wheels function as the one DeadMeat has. The A-10 and the F-16 has a similar function. From the looks of the Ebay link you supplied you can see from the schematics on top of it that it should have a coil. cheers Hans -
I seem to recall Ian advised against those boards as you have to de-solder the resistors and the chip is a MAX485 which should be less suitable than the MAX487. Cheers Hans
-
Hmm slightly odd. I have 5x Arduino Mega’s running on 12VDC on the Vin pin. How did you connect the Vcc on the Max487? According to spec it looks like the AtMega 2560 is less voltage tolerant than the MAX487’s. Cheers Hans
-
Good find sir :thumbup: Cheers Hans
-
What to change Dcs Bios script for slave board
Hansolo replied to Dadzilla74's topic in Home Cockpits
Alright so in your example you want to use a 2-position switch with feed back in both positions connected to pin8 and pin 9 which in your current setup with a single Arduino Mega would look like this; const byte hudAltSwPins[2] = {8, 9 }; DcsBios::SwitchMultiPos hudAltSw("HUD_ALT_SW", hudAltSwPins, 2); You now want to see what it looking like in the DCS-BIOS RS-485 Master Slave setup. First of all the Mega can only hold the Master code which is directly used from the examples; /* Tell DCS-BIOS this is a RS-485 Master. You will need to flash this to a Mega 2560. */ #define DCSBIOS_RS485_MASTER /* Define where the TX_ENABLE signals are connected. You can connect up to three half-duplex RS-485 transceivers. Arduino Pin RS-485 Transceiver Pin TXn ------------------- DI (driver input) RXn ------------------- RO (Receiver Output) UARTn_TXENABLE_PIN ---- /RE, DE (active low receiver enable, driver enable) If you have less than three transceivers connected, comment out the corresponding #define UARTn_TEXENABLE_PIN lines for receivers that are not present. */ #define UART1_TXENABLE_PIN 2 #define UART2_TXENABLE_PIN 3 #define UART3_TXENABLE_PIN 4 #include "DcsBios.h" void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } You can chose to comment out UART2 and UART3 if you want. I am still running on just UART1 for my setup. The Slaves would look like this; /* The following #define tells DCS-BIOS that this is a RS-485 slave device. It also sets the address of this slave device. The slave address should be between 1 and 126 and must be unique among all devices on the same bus. */ #define DCSBIOS_RS485_SLAVE 1 /* The Arduino pin that is connected to the /RE and DE pins on the RS-485 transceiver. */ #define TXENABLE_PIN 2 #include "DcsBios.h" /* paste code snippets from the reference documentation here */ const byte hudAltSwPins[2] = {8, 9}; DcsBios::SwitchMultiPos hudAltSw("HUD_ALT_SW", hudAltSwPins, 2); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Or if you want the same switch for the second Slave; /* The following #define tells DCS-BIOS that this is a RS-485 slave device. It also sets the address of this slave device. The slave address should be between 1 and 126 and must be unique among all devices on the same bus. */ #define DCSBIOS_RS485_SLAVE 2 /* The Arduino pin that is connected to the /RE and DE pins on the RS-485 transceiver. */ #define TXENABLE_PIN 2 #include "DcsBios.h" /* paste code snippets from the reference documentation here */ const byte hudAltSwPins[2] = {8, 9}; DcsBios::SwitchMultiPos hudAltSw("HUD_ALT_SW", hudAltSwPins, 2); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Notice that the Slave number is different. It doesn’t have to be Slave 1 and 2. It could have been 4 and 2. Either of the two Slave unit will then send the following over the RS485 bus to the Master; When switching from pos 0 to pos 1 and when switching back to pos 0 In my setup I am currently running 23 Slave units in DCS-BIOS RS485 Master-Slave configuration. You can argue that the Mega Master is a waste of pins since you cannot connect any I/O’s to it. But it comes out of the box. You most definitely interconnect two Arduino’s using different methods. You just have to figure it out yourself as it doesn’t come with DCS-BIOS natively. You may also use and IO expander like MCP23017 . I had those running in the very first experimental version of DCS-BIOS but later took the RS-485 route. I am not sure if ClayM solve the use of MCP23017 both that could also be worth trying; https://forums.eagle.ru/showthread.php?t=169462 Cheers Hans -
Hi Mole, Have you tried to load the sketch unto another board. It could be that the Arduino is failing. Just guessing here. Cheers Hans
-
What to change Dcs Bios script for slave board
Hansolo replied to Dadzilla74's topic in Home Cockpits
Yeap that's RS485 Master-Slave which is already supplied with DCS-BIOS. But there may of cause be other options that can be made to work. Cheers Hans -
What to change Dcs Bios script for slave board
Hansolo replied to Dadzilla74's topic in Home Cockpits
When speaking of DCS-BIOS master/Slave then it's being run over RS-485 communication using Max487 chips. For setup instructions you can take a look here https://forums.eagle.ru/showthread.php?t=243611 Also when using DCS-BIOS in master/Slave configuration over RS-485 then you cannot add any code for toggle switches etc to the master unit. The master unit only handles communication between DCSW and the Slave units. You can add an additional Arduino board in USB configuration similwto how your current Mega is running. You just need to open a second communication i.e. you need two times connect-serial-port program running. Cheers Hans -
Outstanding sir. Good job :thumbup: Cheers Hans
-
Thanks SteenosMT, Don't use the premade boards from Amazon or Ebay. I can't find it now but Ian advised against it since they all have termination resistors on them. Stay with the MAX-487 chips. Cheers Hans
-
I may just be bouncing of the toggle switch but it surprices me that the first runs through all three states. Please include your code and what module you are working on. Thanks Cheers Hans
-
Not by my PC now but it looks good to me. Nothing will happen now unless you have DCSW running or if you flip a switch on your Arduino board with an appropriate sketch. Cheers Hans
-
Hi Joe, Things are good despite the fact I haven't done very much lately. Well at least just some testing. Buoght a number of Aircore motors a few years back and managed to get those running using a L293D chip after watching GeneB's setup ; Of cause there isn't that much power in the aircore motors but for oxygen, flaps, hydraulics, probably also some of the engine gauges they would work fine. For driving real gauges with secondary needle I am going to need something so tried a to do a few test with steppers. I actually found some NEMA8 which is just a tad smaller. I have also been playing a bit with 5*7dot matrix displays. Started out with your setup 1-to-1 also using PDSP1881 8-digit displays but later decided to use just a single shift register: Then I found some of the same displays WarHog have used HCMS-2963 at a good price in EU. They don't need a shift register so wiring a little simpler still; With regard to the main instrument panel I haven't anything. It's still on the list and it going to take a while before I get to that point. I just picked up DZUS rails today, enough for both left and right side consolo so I better get cracking on making side consoles so I can move into the other pit. Hopefully during winter I get it all moved. It will fill up a little space hich I can then use for something else :-) Cheers Hans
-
Very nice job there sir. looking awesome Cheers Hans
-
Hi fullwoody, Please check the first line in this post; https://forums.eagle.ru/showthread.php?t=240525 You need to include the SwitchMatrix.h or exclude it from your sketch I seem to recall Ian (father of DCS-BIOS) stating that he did not think DCS-BIOS was fast enough for flight controls. The only place I have found a reference for it (in the A-10C) is in this file ; Located here; But it looks like just the animation. Cheers Hans
-
Excellent. Good job sir. Cheers Hans
-
Either way should work, just take care that mine is for RS485 so you will have to leave this out. cheers Hans
-
Hi Mark, Try and check here https://forums.eagle.ru/showpost.php?p=3236594&postcount=159' Cheers Hans
-
Can you start communication's program and check whether you get indications similar to this If your potentiometer is wired correctly then you should be able to read numbers from 0-65535. cheers Hans
-
Excellent Mark McCosker. Good job sir. Glad you made it work :thumbup: Cheers Hans
-
With regard to serial-to-com-port error I found this on 476th vFG Discord channel; I just tried that fix and it seem do have done the trick. I rename my original Socat folder to _Socat and then unpacked this folder where the original Socat folder was; https://drive.google.com/file/d/1Qw1FnZcXTwMHHwW0xc4Jv1kmLF8MEuCz/view?usp=sharing Left everything else the way it was and now the error message is gone. Credit for the fix goes to PrestaMath. Cheers Hans
-
Don't worry about the error code when starting connect-serial-port program. It does that and doesn't mean anything for this issue. Mine does it too. Can you attach your Export.lua file for us? Cheers Hans