/********************************************************
*  Code to access the raw data coming from teh I2C thermo
*  pile array and dispay it on the console.
*  By: Jonathan Mash
*  Date: Feb. 2009
*********************************************************/
 
#include <Wire.h>
byte sensor_address = 0xd0;
 
void setup()
{
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
  Serial.print("Starting TPA81 bus\n");
}
 
void loop()
{
  byte b, s;
  int i;
  for (i=0; i<=9; i++)
  {
    Wire.beginTransmission(sensor_address>>1);
    Wire.send(i);
    Wire.endTransmission();
 
    Wire.requestFrom(sensor_address>>1, (int) 1);
 
    while(Wire.available() < 1)
    { ; }
 
    b = Wire.receive(); // receive a byte as character
 
    Serial.print(b, DEC);
    Serial.print(" ");
 
    delay(10);
  }
  Serial.println("");
 
  delay(500);
}