   Serial.print("  ch 3 = ");
   Serial.print(adc.temp(0x23));
   Serial.println("");
-  Serial.println("");
   delay(5000);
 } 
-

  return true;
}

void TI128D818::write8(uint8_t addr, uint8_t data) {
  Wire.beginTransmission(adc_addr_);
  Wire.write(addr);
  Wire.write(data);
  Wire.endTransmission();
}

uint8_t TI128D818::read8(uint8_t addr) {
  Wire.beginTransmission(adc_addr_);
  Wire.write(addr);
  Wire.endTransmission();
  Wire.beginTransmission(adc_addr_);
  Wire.requestFrom(adc_addr_, (uint8_t)1);
  uint8_t ret;
  ret = Wire.read();
  Wire.endTransmission();
  return ret;
}

uint16_t TI128D818::read16(uint8_t addr) {
  Wire.beginTransmission(adc_addr_);
  Wire.write(addr);
  Wire.endTransmission();
  Wire.beginTransmission(adc_addr_);
  Wire.requestFrom(adc_addr_, (uint8_t)2);
  uint16_t ret;
  ret = Wire.read();
  ret <<= 8;
  ret |= Wire.read();
  Serial.print(" (raw read ");
  Serial.print(ret);
  Serial.print(") ");
  Wire.endTransmission();
  return ret;
}

class TI128D818 {
 public:
  TI128D818();
  TI128D818(const uint8_t add_addr);
  bool init(const uint8_t adc_mode = 0);
  float temp(const uint8_t channel = 0);
 private:
  uint8_t read8(const uint8_t addr);
  uint16_t read16(const uint8_t addr);
  void write8(const uint8_t addr, const uint8_t data);
  void pollUntilReady();
  uint8_t adc_addr_;
};
