OK! I found where is the error!
I feel a little bit silly....

Here the correct code to communicate with the sensor
#include <Wire.h>
void setup(){
Serial.begin(9600);
/*Start communication */
Wire.begin();
}
void getdata(byte *a, byte *b, byte *c){
Wire.beginTransmission(0x60);
Wire.write(0x01); // Data_PMSB_reg address
Wire.endTransmission();
// now get the data from the sensor
Wire.requestFrom(0x60, 3); // "please send me the contents of your first three registers"
while(Wire.available()==0);
*a = Wire.read(); // first received byte stored here
*b = Wire.read(); // second received byte stored here
*c = Wire.read(); // third received byte stored here
}
void loop(){
// Put sensor as standby
Wire.beginTransmission(0x60); //0x60 is sensor address
Wire.write(0x26); //ctrl_reg
Wire.write(0x00); //reset_reg
Wire.endTransmission();
delay(10);
// start sensor as Barometer Active
Wire.beginTransmission(0x60);
Wire.write(0x26);
Wire.write(0x01); //start sensor as barometer
Wire.endTransmission();
delay(10);
byte aa,bb,cc;
getdata(&aa,&bb,&cc);
Serial.println(aa,HEX); //print aa for example
Serial.println(bb,HEX); //print bb for example
Serial.println(cc,HEX); //print cc for example
delay(5000);
}
Now i would like to convert the HEX value into Pascal: i need to create a library to do it. As wrote in the datasheet i must use this code:
void SCI_s18decun_Out (tbar_18 data)
{
byte a, b, c, d, e, f, g, h;
dword r;
/*
** Calculate
*/
a = (byte)((data.LWord>>6) / 10000000); //shift by 6
r = (data.LWord>>6) % 10000000;
b = (byte)(r / 1000000);
r %= 1000000;
c = (byte)(r / 100000);
r %= 100000;
d = (byte)(r / 10000);
r %= 10000;
e = (byte)(r / 1000);
r %= 1000;
f = (byte)(r / 100);
r %= 100;
g = (byte)(r / 10);
h = (byte)(r % 10);
** Format
*/
if (a == 0)
{
a = 0xF0;
if (b == 0)
{
b = 0xF0;
if (c == 0)
{
c = 0xF0;
if (d == 0) {
d = 0xF0;
if (e==0){
e = 0xF0;
if (f == 0){
f = 0xF0;
if ( g == 0 ) {
g = 0xF0;
}
}
}
}
}
}
}
/*
** Output result
*/
SCI_NibbOut (d);
SCI_NibbOut (e);
SCI_NibbOut (f);
SCI_NibbOut (g);
SCI_NibbOut (h);
}
and this:
void SCI_s2fracun_Out (tword data)
{
BIT_FIELD value;
word result;
byte a, b, c, d;
word r;
SCI_CharOut ('.');
/*
** Determine mantissa value
*/
result = 0;
value.Byte = data.Byte.hi;
if (value.Bit._5 == 1)
result += FRAC_2d1;
if (value.Bit._4 == 1)
result += FRAC_2d2;
/*
** Convert mantissa value to 2 decimal places
*/
r = result % 1000;
a = (byte)(result / 1000);
b = (byte)(r / 100);
r %= 100;
c = (byte)(r / 10);
d = (byte)(r % 10);
/*
** Output mantissa
*/
SCI_NibbOut (a);
SCI_NibbOut (b);
}
to convert the fractional component in OUT_P_LSB.
Could someones help me to create the ".CPP" library file?
Thank You all!