i have arduino due board and i want to integrate pressure sensor MPL3115A2 from sparkfun with my board.the interface is I2C.i burned the following code given on the sparkfun website but it doesnt work on my board.help me out.

Usage: -Serial terminal at 9600bps -Prints altitude in meters, temperature in degrees C, with 1/16 resolution. -software enabled interrupt on new data, ~1Hz with full resolution -the IIC_support file contains the IIC read and write functions -IIC_support.ino is just another .ion sketch that holds functions that do not need to be modified.

void sensor_config(){ // To configure the sensor, find the register hex value and // enter it into the first field of IIC_Write (see below). Then // fingure out the hex value of the data you want to send. // // For example: // For CTRL_REG1, the address is 0x26 and the data is 0xB9 // 0xB9 corresponds to binary 1011 1001. Each place holder // represents a data field in CTRL_REG1.

// This configuration option calibrates the sensor according to // the sea level pressure for the measurement location

// BAR_IN_MSB (0x14): IIC_Write(0x14, 0xC6);

// BAR_IN_LSB (0x15): IIC_Write(0x15, 0x5B);}

void sensor_read_data(){ // This function reads the altitude and temperature registers, then // concatenates the data together, and prints in values of // meters for altitude and degrees C for temperature.

// variables for the calculations int m_altitude, m_temp, c_altitude; // these must be floats since there is a fractional calculation float l_altitude, l_temp; float altitude, temperature;

// once there is new data, it is printed Serial.print(altitude); // in meters Serial.print(","); Serial.println(temperature); // in degrees C}

// These are the two I2C functions in this sketch.byte IIC_Read(byte regAddr){ // This function reads one byte over IIC Wire.beginTransmission(SENSORADDRESS); Wire.write(regAddr); // Address of CTRL_REG1 Wire.endTransmission(false); // Send data to I2C dev with option // for a repeated start. THIS IS // NECESSARY and not supported before // Arduino V1.0.1!!!!!!!!! Wire.requestFrom(SENSORADDRESS, 1); // Request the data... return Wire.read();}

I have done i2c with lcd, I have read lcd manual and ran into two problems.Problem 1 was that lcd manufacturer used 8 bit address, so I had to convert it to 7 bits.Problem 2 was that the manufacturer listed the address in the manual and I thought it was already in hex, but the address they listed in reality was a decimal, took me two days to figure it out.So in order to make the lcd work I had to do two things. Convert the decimal to binary, get rid of the last bit so now I had 7 bits for address, convert binary to hex. That, finally!, gave me the right address.

the connection is right.i burned the following I2C scanning code to check slave device addrees but it shows "no I2C device found".http://playground.arduino.cc/Main/I2cScanner i dont is there any problem with DUE board,its beta version IDE or what?

the connection is right.i burned the following I2C scanning code to check slave device addrees but it shows "no I2C device found".http://playground.arduino.cc/Main/I2cScanner i dont is there any problem with DUE board,its beta version IDE or what?

From reading the Due board, the i2cScanner does not work on Due. Lots of people tried it before, so you can forget using i2cScanner at this time.