Jump to content
The simFlight Network Forums

AJiator

new Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by AJiator

  1. Hello, Pavel Sir,

    I am trying to figure out how to work with lua Lvars for past few weeks. I have build few PMDG 737 panels with Mobiflight though, as it already has list of publish offsets. But I am total newbie as far as Lua programming is concerned. I am not a programmer but trying to learn.

    I am trying to build caution light panel for Metal2Mesh Mirage 2000C (M2M M2KC). I have somehow managed to control switches by using fsuipc macros. But dont know what to do for outputs.  I tried your code for parking brakes and it worked like a charm for parking brakes  in M2M Mirage 2000C. Now, I have all the list of Lvars for inputs (Obtained using FSUIPC), But I don`t know how to get output from M2M M2000C for lightning LEDs.

    I got a LUA file for Mirage 2000 for DCS World. But I dont know how to use it in FSX-SE.

    Link to DCS BIOS https://github.com/Exo7/DCS_BIOS-M2000C_Library/releases/tag/v1.20  (Mirage 2000 Lua is in ....\DCS_BIOS-M2000C_Library-1.20\DCS-BIOS\lib\M2000C.lua)

    Is there any way to use above with FSX??

    Also If I could get any help regarding your code (quoted) that how to use it with some other custom Lvars or/and offsets other than parking brakes?

    Any help would be highly appreciated.

    Thank You So Much.

     

    On 2/8/2015 at 2:03 AM, Paja said:

    Ok, got it working... Attached I am sending the easiest ever example of serial communication with arduino. Just paste the INO into your arduino and the LUA into your FSX/Modules and you will get parking brake LED working on the Arduino's onboard LED.

    
    dev = com.open("COM3", 9600, 0)
    
    function pkgbrake(offset, value)
        if value == 0 then
            com.write(dev, "g")
        else
            com.write(dev, "a")
        end
    end
    
    event.offset(0x0BC8, "UB", "pkgbrake")
    
    int strValue = 0;
    int light1 = 0;
    const int out1 = 13; 
    
    void setup()
    {
      Serial.begin(9600);
      pinMode(out1, OUTPUT);
    }
    
    void loop()
    { 
      if(Serial.available() > 0) {
          strValue = Serial.read();
      }
      
    
      if (strValue == 'a')
      {
          digitalWrite(out1,HIGH);
          strValue = 'z';
      }
    
      if (strValue == 'g')
      {
          digitalWrite(out1,LOW);
          strValue = 'z';
      }
    }

    Hope that helps.

     

    Pavel

     

×
×
  • 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.