예제 #1
0
/** Power on and prepare for general usage.
 */
void MS561101BA::initialize() {
	// Reset the device
	reset();
	// Wait for it populates its internal PROM registers
	delay(250);
	// Read PROM registers
	readPROM();
}
예제 #2
0
/** Power on and prepare for general usage.
 */
void MS561101BA::initialize()
{
    if (reset())
    {
        delay(100); // Time after reset, otherwise PROM read fails
        readPROM();
    }
}
int BarometricSensorMS5637::resetDevice()
{
    // Returns 0 if all is OK
    int rcw = 0;
    sensorReady = false;
    Wire.beginTransmission(i2c_addr);
    Wire.write(Dev_Reset);
    rcw = Wire.endTransmission();
    if (rcw) {
        return rcw;
    }
    if (!readPROM()) {
        sensorReady = true;
    }
    return 0;
}
예제 #4
0
/** Device initialization. This function resets the device and load the C's coeficients
 * into the class registers.
 * @param address Optional address, default is 0x77
 * @return 0 = initialization succes, -1 = initialization failure
 */
BYTE MS561101BA::init(BYTE address) {  
  _addr =  address;
  
  // reset the device to populate its internal PROM registers
  if (reset() < 0) {
    return -1;
  }
  // some safety time
  Sleep(5);
  // reads the PROM into object variables for later use
  if (readPROM() < 0) {
   
	  return -1;
  }
  // default 2048 OSR
  oversampling = 0x06;
  
  // standar atmosferic pressure = 1013 mbar
  ref_pressure = 1013;
  
  
  
  return 0;
}
예제 #5
0
bool MS5611::begin(ms5611_osr_t osr) {
    //reset();
    //setOversampling(osr);
    readPROM();
    return true;
}