Results 1 to 5 of 5
  1. #1
    New Member
    Join Date
    Mar 2015
    Location
    Wisconsin, USA
    Posts
    3
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Mycockpit.org Freeing up the I2C pins in the Multi File

    In the Link2fs_Multi Radio for the MEGA I would link to free up the SDA and SCL pins (20&21) to use an I2C compatible display.

    How should I modify the void setup to accomplish this??

    void setup()
    {
    lcd.begin(16, 2); // set up the LCD's number of columns and rows:
    stringoldstate = "111111111111111111111111111111111111111111111111111111111111111111111";
    for (int doutPin = 10; doutPin <= 53; doutPin++) // setup the input pins
    {
    pinMode(doutPin, INPUT);
    digitalWrite(doutPin, HIGH);
    }

  2. #2
    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: Freeing up the I2C pins in the Multi File

    I think it will work if you change like this:
    Code:
      for (int KoutPin = 10; KoutPin < 20; KoutPin++)// Get all the pins ready for "Keys"    {
        pinMode(KoutPin, INPUT);
        digitalWrite(KoutPin, HIGH);  
      }
     for (int KoutPin = KoutPin = 22; KoutPin < 53; KoutPin++)// Get the rest of the pins ready for "Keys"
      {
        pinMode(KoutPin, INPUT);
        digitalWrite(KoutPin, HIGH);  
    
      }

    Life was hard, but then came Windows 7.
    Now we can fly! --------
    --------

  3. Likes Fess_ter liked this post
  4. #3
    New Member
    Join Date
    Mar 2015
    Location
    Wisconsin, USA
    Posts
    3
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Freeing up the I2C pins in the Multi File

    I was thinking along the same lines as what you suggest above. I then question if this will have some effect further down in the program in this area.

    void INPUTPINS(){
    stringnewstate = "";
    for (int pinNo = 10; pinNo <= 53; pinNo++){// checks all the pins 10 to 53
    pinStateSTR = String(digitalRead(pinNo));
    oldpinStateSTR = "";
    oldpinStateSTR += String(stringoldstate.charAt(pinNo - 10));


    Do you think that this will need to be broken into two sections as well?

  5. #4
    150+ Forum Groupie
    Join Date
    Nov 2013
    Location
    Evansville, Indiana
    Posts
    243
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Freeing up the I2C pins in the Multi File

    JJordan,
    What BuzziBi said should work.
    SDA and SCL pins eh?
    Going to do a little Arduino to Arduino Wire communication, or some other module that uses the "Wire" protocol?


    ~Fess
    I will only ever be, half the Geek that I wished I was.
    TheGeekForge.Com

  6. #5
    New Member
    Join Date
    Mar 2015
    Location
    Wisconsin, USA
    Posts
    3
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Freeing up the I2C pins in the Multi File

    BuzziBi and Fess, Thanks for the responses. I will give this a try and see how things work out. I am going to attempt to add a couple of I2C LCD displays and some controls for AutoPilot stuff.

    JJ