A few suggestions:
I've been using other I2C compasses, and you usually need to wait between the command and reading out the reply from the sensor. As it stands, I think you may be bombarding the sensor with commands and never giving it a chance to breathe.
Also, the wire library is a little quirky in how it handles the address of the sensor. If you look at the examples in the playground [edit: uh, the hmc6354 example in the playground seems to be gone, never mind, see below for another example], you will see that the address is usually modified before being used. This means that you are probably not talking to your sensor at all, or rather that it does not realize you are talking to it.
Putting those comments together, here is how I would do it:
#include <Wire.h>
#define CPMS03Address 0xC0
int slaveAddress; // This is calculated in the setup() function
byte data[2]; // This will hold the raw data from the sensor
int result; // This will hold the value that data represents
int i = 0;
void setup()
{
// Shift the device's documented slave address (0xC0) 1 bit right
// This compensates for how the TWI library only wants the
// 7 most significant bits (with the high bit padded with 0)
slaveAddress = CPMS03Address >> 1; // This results in the 7 bit address to pass to TWI
while( millis() < 500) { delay(10); } // The HMC6343 (for example) needs a half second to start from power up
Wire.begin();
}
void loop()
{
Wire.beginTransmission(slaveAddress);
Wire.send(0x01); // Send a "Get Data" command (e.g. (0x50 for the HMC6343)
// or the register number in your case: 0x01
Wire.endTransmission();
delay(2); // The HMC6343 needs at least a 1ms (microsecond) delay
// after this command. Use whatever the data sheet says.
// Read the 2 heading bytes
Wire.requestFrom(slaveAddress, 2); // Request the 2 bytes of data
i = 0;
while(Wire.available() && i < 2)
{
data[i] = Wire.receive();
i++;
}
result = data[0];
result |= data[1] << 8;
Serial.println(result);
}
I haven't tried that code and I don't have that sensor, so you may need to tweak it a bit, but at the very least you need that address trick to make it work, I suspect.