Home Forums EasyTransfer Library Support Forum ETI2C: Sending 14 integers work, sending 16 doesn't work

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3581
    Anonymous
    Inactive

    Hi there, used non I2C version of ET in the past for wireless stuff (APC220), was struggling to get I2C to work and came across the I2C version of ET and was elated, gotten it to do most of what I want but this stumps me.

    I want to network 2 arduinos to extend the amount of inputs, reason being I have a Pro Micro with a ATmega32U4 which has native USB HID support and I’m making a game controller, but the Pro Micro doesn’t have a lot of inputs, and most of the buttons/axis are on a moving part away from where I want to connect the USB port so I thought why not put a pro mini (ATmega328) closer to the inputs and just wire 5v, GND and communication back to the Pro Micro from it. (SCL and SDA pins for I2C). Reason I picked I2C is that I got I2C LCDs and I’m probably going to use one in this project, and I figured it would be possible to add more arduinos to extend it even further.

    Trouble is in my testing I simply can’t get more than 14 integers to work, I’m not entirely clear how ETI2C on the backend handles these integers and if there is some way to compress it down to fit.

    I’ll provide my code for reference

    12 buttons 2 axis over ETI2C: as ints
    Master Throttle Base Pro Micro ATmega32U4 http://pastebin.com/1D97gwfU
    Slave Throttle Handle Pro Mini ATmega328 http://pastebin.com/UveYZrUp

    12 buttons 4 axis over ETI2C as ints: (didn’t bother adding back in the joystick library stuff for the 2 extra axis)
    Master Throttle Base Pro Micro ATmega32U4 http://pastebin.com/dAgw3jYi
    Slave Throttle Handle Pro Mini ATmega328 http://pastebin.com/1HFPXrBP

    First set works for me, second set the ATmega32U4 just blinks and doesn’t update the joystick HID stuff (I’ve coded it to flash the LED if it’s not getting data).

    Any suggestions how to fix this? I thought maybe combining some of the ints might work or switching the buttons to boolean though I’m not sure if that helps or not, it’s a bit of a hassle programming both arduinos because I need to re-wire stuff to program them etc so my rate of experimentation is a bit low.

    I’m a bit puzzled by ETI2C from what I understand I2C normally has a master and a slave with the master requesting data from the slave which sends it back on request, but ETI2C seems structured to have the transmitting device just send continually and receiving device just accept it?

    Would it be possible to send and receive between multiple devices simultaneously? Say the ATmega32U4 sends I2C traffic to an LCD while receiving traffic from the ATmega328?

    #3584
    Anonymous
    Inactive

    I believe there’s a limitation imposed due to the nature of i2c (I thought I read this in the ET documentation).  However, you might take a look at what I discovered (in my post) with the Serial version and baud rate.  It might give you an option or a slightly different direction.  FWIW.

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