Results 1 to 9 of 9
  1. #1
    25+ Posting Member Doug77's Avatar
    Join Date
    Aug 2012
    Location
    scotland
    Posts
    49
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Link2FS-I2C & Arrays?

    Hi All,

    Im new to Arduino and am struggling to learn how to get it to do what I want.. any pointers much appreciated

    Im running Jims Link2FS (thanks Jim!!)... Im trying to use two arduinos as a master/slave setup communicating over I2C


    What I have been trying to do is have the Master communicate with Link2FS (thats all working fine) ..then Send the com1 data (array?) via I2C to the slave which is controlling a 5 digit 7seg display (multiplexed)

    I have tried many different things so far with no luck though I have now got a fragile grasp on handling arrays,strings etc

    My questions are;

    1.Does anyone already have examples of how to do this??

    2. if (can) I tell the master to write the com1 data directly to the slave...what is actually transmitted? is it an array/string etc

    3. how do I extract the received data as a number (integer) such as 12730 which represents a com1 reading 127.30Mhz ? Ive already figured out how to manipulate the com1 to give a reading of 12730 (or whatever freq is set in FS) on the LCD driven from the Master arduino

    sorry if thats all a bit vague but like I said im a newbie and am trying, spent hours trying things and reading pages and pages of web


    Thanks for your patience
    Doug..

  2. #2
    25+ Posting Member Doug77's Avatar
    Join Date
    Aug 2012
    Location
    scotland
    Posts
    49
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Link2FS-I2C & Arrays?

    A less long-winded version of my question


    How do I send Com1 from Master to slave over i2C??
    any examples appreciated

    Thanks all

  3. #3
    25+ Posting Member zulucat's Avatar
    Join Date
    Sep 2012
    Location
    Southern SoCal
    Posts
    36
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Link2FS-I2C & Arrays?

    Quote Originally Posted by Doug77 View Post
    2. if (can) I tell the master to write the com1 data directly to the slave...what is actually transmitted? is it an array/string etc
    That's up to you. It's whatever you choose to send.

    -------

    I've attached a ZIP file which contains two Uno sketches that demonstrates the use of I2C to send data between two Uno's. You will need to connect A4 to A4, A5 to A5 and GND to GND.

    I assume you are using a variation of Jim's code. Since that code uses strings of data I've written the demo code to show how how to send a string.

    I also assumed that you are using an ASCII text LCD display with the LiquidCrystal Library. I'm using a 16x2 display. You may need to alter the following statements in SlaveI2C to get the LCD to work.


    #define COLS 16
    #define ROWS 2
    LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

    Doug -
    Attached Files Attached Files

  4. Thanks Doug77, AK Mongo thanked for this post
    Likes Doug77 liked this post
  5. #4
    25+ Posting Member Doug77's Avatar
    Join Date
    Aug 2012
    Location
    scotland
    Posts
    49
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Link2FS-I2C & Arrays?

    Hi Zulucat,

    Thanks very much for the reply and the code... just what I was looking for I had a tenuous grasp of using i2c to send simple bits but was struggling with strings and arrays.
    Im off now to play with the code you have sent me and hopefully that will clarify the situation

    Your help is much appreciated

    Doug.

  6. #5
    25+ Posting Member Doug77's Avatar
    Join Date
    Aug 2012
    Location
    scotland
    Posts
    49
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Link2FS-I2C & Arrays?

    Hi again Zulucat,

    there appears to be a problem with the ._slave file in your zip... the rest are spot on

    thanks again

  7. #6
    25+ Posting Member zulucat's Avatar
    Join Date
    Sep 2012
    Location
    Southern SoCal
    Posts
    36
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Link2FS-I2C & Arrays?

    Quote Originally Posted by Doug77 View Post
    there appears to be a problem with the ._slave file in your zip... the rest are spot on
    I think that the two files in the archive that start will "._" are an inadvertent byproduct of the ZIP program/process I used on my MAC. You can get rid of them if you haven't already done so. Sorry 'bout that!

    Doug -

  8. #7
    25+ Posting Member Doug77's Avatar
    Join Date
    Aug 2012
    Location
    scotland
    Posts
    49
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Link2FS-I2C & Arrays?

    Ahhhhhhh ok thanks Zul,

    Ive been trying different things all afternoon with the code you sent and it look fairly promising so far, I can now send the data to the slave and am just trying to get it to drive the 5 digit multiplexed 7 seg display, am using a 5 digit demo code [C] digit 7 segment LED display control for arduino - Pastebin.com and attempting to alter it to use the received data
    Not knowing much about arduino and programming its a real hill climb but im getting there
    once again many thanks for you help


    ...Doug

  9. #8
    25+ Posting Member Doug77's Avatar
    Join Date
    Aug 2012
    Location
    scotland
    Posts
    49
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Link2FS-I2C & Arrays?

    Think I need a holiday... Ive only just realised that your name is Doug as well...I saw the name in your replies but didn`t catch on!!!!!!

    So from one Doug in Scotland to another Doug....SEASONS GREETINGS!!!

  10. #9
    25+ Posting Member zulucat's Avatar
    Join Date
    Sep 2012
    Location
    Southern SoCal
    Posts
    36
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Link2FS-I2C & Arrays?

    Quote Originally Posted by Doug77 View Post
    So from one Doug in Scotland to another Doug....SEASONS GREETINGS!!!
    And from the other Doug in Sunny Southern California ... best wishes to you and yours for the coming holiday season!