Home Forums EasyTransfer Library Support Forum Max number Objects problem

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3274
    Anonymous
    Inactive

    hey all,

    I am aware of the 255 byte limit for easy transfer.. by my calculations i should be able to include all the variables that follow. unfortunately I have been failing at this for days now.  I am using 6 arduinos total, 5 slaves sending floats to one master to calculate the information and send it back to the slaves. I am using several boolean statements for state changes as well.

    is this possible with this library? or should i just be using i2c traditional?

    the other code works great, but it fails to communicate when i add in too many variables.

    I’m a grad student and this is fairly time sensitive.

    thanks,

     

     

    #include <Wire.h>

    #include <EasyTransferI2C.h>

     

    //create object

    EasyTransferI2C ETin, ETout;

     

    struct SEND_DATA_STRUCTURE{   // easytransfer

    //put your variable definitions here for the data you want to send

    //THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO

    bool masterRdy1;

    bool masterRdy2;

    bool masterRdy3;

    bool masterRdy4;

    bool masterRdy5;

    bool masterSendRdy1;

    bool masterSendRdy2;

    bool masterSendRdy3;

    bool masterSendRdy4;

    bool masterSendRdy5;

    bool masterDispenseRdy;

    float masterPublicIndividual;

    float masterPrivate1;

    float masterPrivate2;

    float masterPrivate3;

    float masterPrivate4;

    float masterPrivate5;

    };

    struct RECEIVE_DATA_STRUCTURE{   // easytransfer

    //put your variable definitions here for the data you want to recieve

    //THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO

    bool slaveRdy1;

    bool slaveRdy2;

    bool slaveRdy3;

    bool slaveRdy4;

    bool slaveRdy5;

    bool slaveSendRdy1;

    bool slaveSendRdy2;

    bool slaveSendRdy3;

    bool slaveSendRdy4;

    bool slaveSendRdy5;

    float slavePrivate1;

    float slavePublic2;

    float slavePublic3;

    float slavePublic4;

    float slavePublic1;

    float slavePublic5;

    float slavePrivate2;

    float slavePrivate3;

    float slavePrivate4;

    float slavePrivate5;

     

     

    };

    //give a name to the group of data

    RECEIVE_DATA_STRUCTURE dataIn;

     

    //give a name to the group of data

    SEND_DATA_STRUCTURE dataOut;

     

     

    //define slaves i2c address

    #define station1 1

    #define station2 2

    #define station3 3

    #define station4 4

    #define station5 5

    #define master   6

    #3275
    Anonymous
    Inactive

    Hi,
    I’m using an boolean array with a size of 45 and also 3 single byte values in my struct without any problems. But I’m using the normal (not I2C) Variant.

    Maybe you shoud try to bring your boolean data in an array?
    Also you can try to change the baudrate up/down. My best experience is at 9600Bauds
    Don’t forget the grounding of all parts. Maybe start at first with only two Arduinos and let it grow when it works

    Greetings
    Pac-Man

    #3280
    Bill
    Member

    Bravado,

    Without seeing all your code everything you reported here should work. You are well under the byte limit so it may be something else going on.

     

    You could store your bool values into 2 bytes instead of 10 (Bool values are a byte each even though they are 2 state). Each bit in the byte could represent a a different flag.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.