sensor_properties *newPressureSensor(short SensorAdress, short calibrate) { sensor_properties *temp; temp = malloc(sizeof(sensor_properties));// reserve memory if (temp == NULL) {return NULL;} // not enough ram available, exit temp->SensorAdress = SensorAdress; // store sensor adress temp->SensorType = SensorType; // store sensor type (unused, might be useful if you add multiple sensors) if (calibrate){ I2C0_SetSlaveAdress(SensorAdress); MS_Calibration(temp); // calibrate the sensor sleep(100); } return temp; // sensor has been added and calibrated, exit }