Multiple SMBus Temperature sensors

I have two temperature sensors, the Melexis MLX90614 and i cannot get both of them to work. I have seen other threads about this sensor and it works, but only for the one sensor. Here is the code i have, how can i assign an address to the second one so i can get two separate temperature values?

#include <i2cmaster.h>

void setup() 
{ 
Serial.begin(9600); 
i2c_init(); //Initialise the i2c bus 
PORTC = (1 << PORTC4) | (1 << PORTC5);//enable pullups 
} 
void loop() 
{ 
int dev = 0x5A<<1; 
int data_low = 0; 
int data_high = 0; 
int pec = 0; 
i2c_start_wait(dev+I2C_WRITE); 
i2c_write(0x07); 


i2c_rep_start(dev+I2C_READ); 
data_low = i2c_readAck(); //Read 1 byte and then send ack 
data_high = i2c_readAck(); //Read 1 byte and then send ack 
pec = i2c_readNak(); 
i2c_stop(); 

//This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for temps 
double tempFactor = 0.02; // 0.02 degrees per LSB 
double tempData = 0x0000; 
int frac; 

// This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte. 
tempData = (double)(((data_high & 0x007F) << 8) + data_low); 
tempData = (tempData * tempFactor)-0.01; 
tempData = tempData - 273.15; 
Serial.print((int)tempData); //Print temp in degrees C to serial 
Serial.print("."); 
tempData=tempData-(int)tempData; 
frac=tempData*100; 
Serial.println(frac); 
delay(100);  
}

According to section 8.3.3 of the data sheet, the slave address is stored in EEPROM, at address 0x00E, and that that address is writable.

So, it would seem that you CAN assign a different slave address to a device.

Section 8.4.6 details what to send to the device to read/write specific values. Exactly what to write is up to you. Exactly how is left as an exercise for the student.

Alright so if i want to assign a new address to the sensor, how do i know that i am talking to the right one? if they both start with the same address then how can i communicate with a specific one?

Alright so if i want to assign a new address to the sensor, how do i know that i am talking to the right one?

This defines the address of the one you want to talk to.

int dev = 0x5A<<1;

if they both start with the same address then how can i communicate with a specific one?

Darryl: I’d like you all to meet my brother Darryl, and my other brother Darryl.

You can’t. That’s why you need to give one of them a different address.

since these use EEPROM the address is stored even after it loses power correct? so in order to give one of the sensors another address should i just plug in one and assign it an address and it will stick?
as far as changing the address I tried just upping the number like this

int dev = 0x6A<<1;

But it doesnt exactly work that way. I was wondering if i need to use the old address first and then send a write command, but im not sure what to send it

since these use EEPROM the address is stored even after it loses power correct?

Yes.

so in order to give one of the sensors another address should i just plug in one and assign it an address and it will stick?

In a different sketch, just for that purpose, yes.

I was wondering if i need to use the old address first and then send a write command

Yes.

but im not sure what to send it

Back to the data sheet, then.

the datasheet shows for EEPROM access to send 001x xxxx where the x indicates what to be written, but I'm not sure what it should be sent. Also, what is an acceptable value for the address? By default the address is 0x5A but using the aforementioned code how do i change that and what should it be changed to?

bump. I'm still not sure what number should be sent because i can't just send the full number from the datasheet right? it has to be in a different format like the 0x5A