Results 1 to 8 of 8
  1. #1
    25+ Posting Member
    Join Date
    Feb 2013
    Location
    mora
    Posts
    63
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    LED's using Link2fs

    Can Link2fs be use to turn on and off a led light for this switch?
    deskpilot.



    // SPEED Button
    if (current_pin == 44)
    {
    if (digitalRead(44) == LOW) // SPEED Button is depressed and we need to Send a command
    {
    Serial.println ("B26");
    }
    }
    Attached Files Attached Files

  2. #2
    75+ Posting Member
    Join Date
    Nov 2011
    Location
    UK
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: LED's using Link2fs

    Yes you can but you have to use SimConnect Extraction(1) tab and tick either =f or =g

    and in your code your would need something like.

    void EQUALS(){ // The first identifier was "="
    CodeIn = getChar(); // Get the second identifier
    switch(CodeIn) {// Now lets find what to do with it
    case 'a'://Found the second identifier ("a" AP on/off)
    ap = "";{
    ap += getChar();
    int apINT = ap.toInt(); // convert it to an integer
    if (apINT > 0){digitalWrite(7, HIGH);}else{digitalWrite(7, LOW);}//action the LED
    break;
    }

  3. #3
    25+ Posting Member
    Join Date
    Feb 2013
    Location
    mora
    Posts
    63
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: LED's using Link2fs

    Thank you Marc for the info. I understand the part for the SimConnect(1) tab, however I don't understand the code talk. Could you please insert the info into the code from above post (word) and I will change my code in notepad ++ and see if it will work.

    Thanks again, Deskpilot

  4. #4
    25+ Posting Member
    Join Date
    Feb 2013
    Location
    mora
    Posts
    63
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: LED's using Link2fs

    Here is a copy of my code.
    Attached Files Attached Files

  5. #5
    75+ Posting Member
    Join Date
    Nov 2011
    Location
    UK
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: LED's using Link2fs

    I have attached my autopilot .ino file which I have not yet finished but there is enough information there for you. You should be able to copy and paste it to wherever you need it. All you will need to change are the pin numbers and the void EQUALS case letters. I hope this is of some help.
    Attached Files Attached Files

  6. #6
    25+ Posting Member
    Join Date
    Jul 2016
    Location
    Madrid
    Posts
    41
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: LED's using Link2fs

    An importan thing is that you wouldn't switch on more than 5-10 leds at the same time, with direct pins in arduino.
    Arduino can manage 200ma current.
    A typical led use 20ma.
    And I would prefer not use more than 5 at the same time.

    You can use NPN transistors and external power to switch on all the leds you want at the same time.

    Arturo.

  7. #7
    25+ Posting Member
    Join Date
    Feb 2013
    Location
    mora
    Posts
    63
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: LED's using Link2fs

    Thank you all for the info. I will try to see if I can make this work.

    deskpilot

  8. #8
    25+ Posting Member
    Join Date
    Feb 2013
    Location
    mora
    Posts
    63
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: LED's using Link2fs

    Marc, the pins that you are using, 7,8,9,10,11. Are those PWM or Analog pins? and does it matter if I use "G" for all of my LED's on my switches?
    deskpilot