Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Aviation Enthusiast
    Join Date
    Sep 2013
    Location
    Cornwall, UK
    Posts
    42
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Where is the PDE_inOut_v1.PDE file?

    Do excuse my second post but I managed to setup your basic keys program earlier but I want the outputs offered by this program. I've tried uploading the inout.ino file but that didn't work - I can't find the PDE_inOut_v1.PDE file anywhere in the link2fs_inout_v4.zip

    Am I being stupid?

  2. #2
    Aviation Enthusiast
    Join Date
    Sep 2013
    Location
    Cornwall, UK
    Posts
    42
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Where is the PDE_inOut_v1.PDE file?

    Well I went with the multi link2fs version! Jim - it's brilliant.

    What I want to know is - I've installed the multi_keys.ino can I add code to allow this (whilst running keys) to output to an LCD as well?

  3. #3
    150+ Forum Groupie BuzziBi's Avatar
    Join Date
    Mar 2013
    Location
    Norway
    Posts
    275
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Where is the PDE_inOut_v1.PDE file?

    If I understood the question correctly?
    Yes you can have code for "KEYS" and "LCD" simultaneously, in the same code.
    I just tested a code to be sure.
    Personally, I plan to run the "KEYS" on a Arduino Uno, with no other code to make problems for me.
    Running the other tings on separate cards.
    Below is my test code for the multi link2fs. Good luck


    Code:
    /* 
        This code is for testing KEYS and LCD display the Altitude On The Arduino Uno Card.
        LCD on pin: 2, 3, 4, 5, 6, 7.
        Pushbutton on pin: 8.
    */
    int CodeIn;// used on all serial reads
    int KpinNo; 
    int Koutpin;
    
    
    #include 
    LiquidCrystal lcd(7, 6, 5, 4, 3, 2); //Eks. To Display Altitude
    
    
    String KoldpinStateSTR, KpinStateSTR, Kstringnewstate,Kstringoldstate;
    
    
    String ALTLevel, ALTLevelold;  //Eks. To Display Altitude
    
    
    void setup() 
    {
      Kstringoldstate = "111111111111111111111111111111111111111111111111111111111111111111111";
      
      for (int KoutPin = 8; KoutPin < 20; KoutPin++)// Get all the pins ready for "Keys"  
      {
        pinMode(KoutPin, INPUT);
        digitalWrite(KoutPin, HIGH);  
      }
     Serial.begin(115200); 
    
    
      lcd.begin(16, 2);
      // Print a message to the LCD.  
      delay (11);
      lcd.print("This Is Altitude");
      delay (11);
      lcd.setCursor(0, 1);
      delay (11);
    }
    
    
    void loop() {
      {KEYS();} //Check the "keys" section
      if (Serial.available()) {
        CodeIn = getChar();
        if (CodeIn == '=') {EQUALS();} // The first identifier is "="
        if (CodeIn == '<') {LESSTHAN();}// The first identifier is "<"
        if (CodeIn == '?') {QUESTION();}// The first identifier is "?"
        if (CodeIn == '/') {SLASH();}// The first identifier is "/" (Annunciators)
      }
    }
    
    
    char getChar()// Get a character from the serial buffer
    {
      while(Serial.available() == 0);// wait for data
       delay (2);  // Insert delay her to avoid the LCD to overwrite figure's
      return((char)Serial.read());// Thanks Doug
    }
    
    
    void EQUALS(){      // The first identifier was "="
     CodeIn = getChar(); // Get another character
      switch(CodeIn) {// Now lets find what to do with it
        case 'A'://Found the second identifier
           //Do something
        break;
         
        case 'B':
           //Do something
        break;
         
        case 'C':
           //Do something
        break;
        
             //etc etc etc
         }
    }
    
    
    void LESSTHAN(){    // The first identifier was "<"
    CodeIn = getChar(); // Get another character
      switch(CodeIn) {// Now lets find what to do with it
    
    
    case 'D'://Found the second identifier "ALTITUDE"
                  ALTLevel = "";
                  ALTLevel += char(Serial.read());
                  ALTLevel += char(Serial.read());
                  ALTLevel += char(Serial.read());
                  ALTLevel += char(Serial.read());
                  ALTLevel += char(Serial.read());
                  ALTLevel += ("   "); //pads it up to 8 caracters
                  if (ALTLevel != ALTLevelold){
                       lcd.setCursor(1, 1);
                       lcd.print(ALTLevel);}
                                        
        break;
         
    
    
           
             //etc etc etc
         }
    }
    
    
    void QUESTION(){    // The first identifier was "?"
    CodeIn = getChar(); // Get another character
      switch(CodeIn) {// Now lets find what to do with it
        case 'A'://Found the second identifier
           //Do something
        break;
         
        case 'B':
           //Do something
        break;
         
        case 'C':
           //Do something
        break;
           
             //etc etc etc
         }
    }
    void SLASH(){    // The first identifier was "/" (Annunciator)
      //Do something
    }
    void KEYS() 
    {
      Kstringnewstate = "";
      for (int KpinNo = 8; KpinNo < 20; KpinNo++){
        KpinStateSTR = String(digitalRead(KpinNo)); 
        KoldpinStateSTR = String(Kstringoldstate.charAt(KpinNo - 8));
        if (KpinStateSTR != KoldpinStateSTR)
        {
          if (KpinNo != 13){
          Serial.print ("D"); 
          if (KpinNo < 10) Serial.print ("0");
          Serial.print (KpinNo);
          Serial.println (KpinStateSTR);
          }
        }
        Kstringnewstate += KpinStateSTR;
      }
      Kstringoldstate = Kstringnewstate;
    }
    Life was hard, but then came Windows 7.
    Now we can fly! --------
    --------

  4. #4
    Aviation Enthusiast
    Join Date
    Sep 2013
    Location
    Cornwall, UK
    Posts
    42
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Where is the PDE_inOut_v1.PDE file?

    I decided to go with the simconnect code method so using codes such as 'CO1' for the gears etc. I assume you could still implement the LCD code with this?

  5. #5
    500+ This must be a daytime job Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    764
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Where is the PDE_inOut_v1.PDE file?

    Sam ,, Of course you can ,, that's what makes the Arduino so versatile.

    My "Multi" program allows you to extract from FSX all of those parameters for you to play with and it has two means of inputting ,, simconnect and "keys".

    The "keys" bit is also recognized by FSUIPC once you program FSUIPC for that keystroke.(or combination)

    And as far as simconnect ,,, FSUIPC just use's simconnect for a lot of things at any-rate so if what you need is in the "Multi"s simconnect list ,,, then just use the "Multi" simconnect bit.(Less steps to take)

    How you program the Arduino is up to you, but study some INO's to get idea's, read the documentation and fiddle.

    Thanks BuzziBi. our case's are just about packed.
    We're off to Aussie.

    Jim

    Added ,,,
    As far as LCD's go ,,, any output (extraction) can be sent to the Arduino card and used for anything you like ,,, LCD's, LED's, servo's, meters, relays, etc etc ,, your choice
    Last edited by Jim NZ; 10-07-2013 at 07:03 PM.
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  6. #6
    Aviation Enthusiast
    Join Date
    Sep 2013
    Location
    Cornwall, UK
    Posts
    42
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Where is the PDE_inOut_v1.PDE file?

    If I'm using the simconnect way of sending commands could I:

    With a toggle switch send a command when I turn it on (say to turn on the wing lights) and then when I turn it off to then turn off the previous command (i.e. turn off the wing lights).

  7. #7
    10+ Posting Member
    Join Date
    Jul 2012
    Location
    Madison Al.
    Posts
    10
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Where is the PDE_inOut_v1.PDE file?

    Quote Originally Posted by samfranklin View Post
    I can't find the PDE_inOut_v1.PDE file anywhere in the link2fs_inout_v4.zip
    I also cannot find this file. Multi is great but I am running P3Dv2 not FSX.
    Last edited by Nukem; 11-27-2013 at 11:47 PM. Reason: fix quote

  8. #8
    500+ This must be a daytime job Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    764
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Where is the PDE_inOut_v1.PDE file?

    That file was to suit the earlier Arduino IDE but when the newer version ( 1 upwards) came along, that file had to adapted to suit.
    The new file is called "pde_inout_v4.pde" which is included in the current release of the "Link2fs_inOut_v4j" program.
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  9. #9
    10+ Posting Member
    Join Date
    Jul 2012
    Location
    Madison Al.
    Posts
    10
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Where is the PDE_inOut_v1.PDE file?

    Quote Originally Posted by Jim NZ View Post
    The new file is called "pde_inout_v4.pde" which is included in the current release of the "Link2fs_inOut_v4j" program.
    I don't think that one is in there either. There is an arduino .ino but it appears to be an lcd output program. Please forgive me if I am missing the obvious but I am completely new to arduino.

  10. #10
    150+ Forum Groupie
    Join Date
    Apr 2011
    Location
    United States of America
    Posts
    232
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Where is the PDE_inOut_v1.PDE file?

    Hello Nukem.

    It seems Jim's brain was in 'PDE' mode and he mistyped; he meant to write 'INO_inout_v4.ino'.
    If you're trying to locate the 'Keys' portion, it is located at the bottom of the sketch.

    Hope this helps.

Page 1 of 2 12 LastLast