I'm struggling to get my TWI reading out, Im not sure where Im going wrong?

TMP102 DataSheet
https://www.sparkfun.com/datasheets/Sensors/Temperature/tmp102.pdf

Any help or example would me really appreciated. 

Main Class:

// IOIO pin 26 = SDA, pin 25 = SCL

private final int twiNum = 26;

 // TextView Display Temperature

private TextView tmpTextView;

 private TwiMaster twi;

 int address;

 byte[] request = new byte[] { 0x00, 0x48};

byte[] response = new byte[4];

Setup:

twi = ioio_.openTwiMaster(twiNum, TwiMaster.Rate.RATE_100KHz, false);

Loop:

address = 0x48;

 try {

    twi.writeRead(address, false, request, request.length, response, 
response.length);

    /* Update UI */

  updateViews();

  } catch (InterruptedException e) {

  ioio_.disconnect();

 } catch (ConnectionLostException e) {

  throw e;

  }

private void updateViews() {

 runOnUiThread(new Runnable() {

 @Override

 public void run() {

  tmpTextView.setText(String.valueOf(response));

 }

 });

 }    

-- 
You received this message because you are subscribed to the Google Groups 
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to