Jump to content
The simFlight Network Forums

Emerson Schmidt

new Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Emerson Schmidt

  1. Hi there. I've just developed a system landing gear using it for FSX and Prepr3D whose working fine for them. But for X-plane 11 and XPUIPC once it is enabled, it does not communicate with my app using fsuipc.dll from Paul. So I'm load of things in development (many gauges, instruments, displays, radios and so on) and I will be focused on only FSX and mainly, the PREPAR3D. This stuff is already so complicated and so many clallenges to overcome every single day. Better this way or I'm gonna be crazy. I got happy that there are more people with same difficulties so I'd rather give X-PLANE up for now.
  2. Hi Paul, Emerson (from Virtual Aviation) again! My LandGear is finalized. Everything's fine. Now I'm in another challenge. To export flaps offset 0BDC to a servo on arduino board. Could you help me out in this new challenge? Here's part of my code in C# (see red bold font) 1-Setting the offset: // ===================================== // DECLARE OFFSET // ===================================== private Offset<int> flaps = new Offset<int>(0x0BDC); 2-Loop timerMain : private void timerMain_Tick(object sender, EventArgs e) { // Call process() to read/write data to/from FSUIPC // We do this in a Try/Catch block incase something goes wrong try { FSUIPCConnection.Process(); // Update the information on the form // (See the Examples Application for more information on using Offsets). // exporting flaps data to a servo this.txtFlaps.Text = flaps.Value.ToString(); port.WriteLine(flaps.Value.ToString()); } } catch (Exception ex) { // An error occured. Tell the user. MessageBox.Show("Connection Failed\n\n" + ex.Message, "FSUIPC", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } configureForm(); } -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Here's the arduino firmware, very simple: #include<Servo.h> Servo base; void setup() { base.attach(8); Serial.begin(9600); } void loop() { int val=Serial.parseInt(); if(val!=0) { base.write(val); } } *************************************************************** What is working ? Paul, when FSUIPC connects and flaps are UP == 0 , at the time I change the flaps with 1 degree (first notch) flaps value == 2048 . Servo makes no movement. When I set flaps 2, flaps value == 4096 and servo moves 90 degrees approximately. Then I set flpas == 5 and and txt.flaps value == 4096 and servo keep steady (no changes). And nothing changes on servo as the values changes in txtFlaps on each new flap position is set but servo only changes from flap position 1 to 2 and 2 to 1. Flaps value from 2048 to 4096 and from 4096 to 2048. I think I have to creat a new firmware that according to each value arduino receives from C# (0 to 16383) , it set a servo position angle according to these values. Am I correct? Do you know another way to make the servo recognizes each flap notch and applying these values to the servo? I would be happy if you could help me out here. Thanks in advance. Best Regards, Emerson Schmidt Virtual Aviation - Brazil
  3. Hi Paul. Firstly, I want to apologize you by not thank you for your quick response to me about my issue in connecting FSX-FSUIPC - MY APP - ARDUINO HARDWARE. Thank you very much. Secondly, as I said I'm still a newby in development in C# and Arduino as well. I was so focused on this and had so many barries to overcome that said to myself that: " this is not for me". But I should study a little bit about C# and Arduino Development Program before doing what I was intended to do. And as I said before, I was so focused on this by have a good one. Mr. Paul, I've got it working fine exactly I developed it for! I was creating the structure, item by item. My APP is responsable to do thing in both directions, send information from FSX and reads information from the Arduino (Switch of Landing Gear Up/Down) and send it back to write a new offset value and then, changing a situation. I hope I can express well this for you , my English is not good. At last, I got it. Now I install the Arduino into a specific landing gear hardware and sell it to the world. And I will start new products as MCP, EFIS, FCUs (Airbus) and who knows, a complete Overhead panel. I'm a 51 year-old man. This will be my unique income from now on and I still happy becuase I've never programmed anything for Windows Desktop in my life. But had experienced with Linux, Shell script. Paul, once again, sorry to delay to much in answering you and thanks to your examples on using FSUIPC.DLL I got it. As I have success on selling my software and Landing Gear, I will donate some money to you as credits. Thank you kindly. EMERSON SCHMIDT IN-DEPTH FLIGHT SIM SYSTEMS | BRAZIL
  4. Hi There! Paul, I'm a newbie in C# but very experienced with FSUIPC, making macros, association with a lot of joysticks and so on. But now, I'm trying to make to export the landing gear led from C# to serial.port Arduino and make these leds (all leds : moving and when gear is extend as well total of 6 leds) lit. I attempted by using your code by turning a led on if avionicsMaster button is checked. See code below: namespace FSUIPCWinFormsApp8 { public partial class frmMain : Form { // ===================================== // DECLARE OFFSETS YOU WANT TO USE HERE // ===================================== private Offset<uint> airspeed = new Offset<uint>(0x02BC); private Offset<uint> avionicsMaster = new Offset<uint>(0x2E80); public frmMain() { InitializeComponent(); serialPort1.PortName = "COM4"; // inserted by me serialPort1.BaudRate = 9600; // inserted me configureForm(); } // The connect/disconnect buton private void btnToggleConnection_Click(object sender, EventArgs e) { if (FSUIPCConnection.IsOpen) { // Connection is currently open // Stop the main timer this.timerMain.Stop(); // Close the connection FSUIPCConnection.Close(); } else { // Try to open the connection try { this.lblConnectionStatus.Text = "Looking for a flight simulator..."; this.lblConnectionStatus.ForeColor = Color.Goldenrod; FSUIPCConnection.Open(); // If there was no problem, start the main timer this.timerMain.Start(); } catch (Exception ex) { // An error occured. Tell the user. MessageBox.Show("Connection Failed\n\n" + ex.Message, "FSUIPC", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } configureForm(); } // This method runs 20 times per second (every 50ms). This is set on the timerMain properties. private void timerMain_Tick(object sender, EventArgs e) { // Call process() to read/write data to/from FSUIPC // We do this in a Try/Catch block incase something goes wrong try { FSUIPCConnection.Process(); // Update the information on the form // (See the Examples Application for more information on using Offsets). // 1. Airspeed double airspeedKnots = (double)this.airspeed.Value / 128d; this.txtAirspeed.Text = airspeedKnots.ToString("F0"); // 2. Master Avionics this.chkAvionicsMaster.Checked = avionicsMaster.Value > 0; } catch (Exception ex) { // An error occured. Tell the user and stop this timer. this.timerMain.Stop(); MessageBox.Show("Communication with FSUIPC Failed\n\n" + ex.Message, "FSUIPC", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); // Update the connection status configureForm(); } } // This runs when the master avionics tick has been changed private void chkAvionicsMaster_CheckedChanged(object sender, EventArgs e) { // Update the FSUIPC offset with the new value (1 = Checked/On, 0 = Unchecked/Off) this.avionicsMaster.Value = (uint)(this.chkAvionicsMaster.Checked ? 1 : 0); // MessageBox.Show("this.avionicsMaster.Value"); // HERE'S THE ISSUE: I just want to send to Arduino and make a led on (if Aviation Master is checked and off if opposite). Then, The main purpose: install 6 led and make them operate as land gear status. Could you please, give me a help here?? // serialPort1.Open(); if (serialPort1.IsOpen) { serialPort1.WriteLine("1"); } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.