Exemplo n.º 1
0
//------------------------------------------------------------------------------
// Loop Function - Arduino Program Loop
//------------------------------------------------------------------------------
void loop()
{
    digitalWrite(13, HIGH);
    delay(1000);
    digitalWrite(13, LOW);
    delay(100);
    
	Serial.println("Updated numbers");
    Serial.print("Temperature: ");
    Serial.print(bmp.temperature(),2);
    Serial.println(" deg C");
    
    Serial.print("Pressure: ");
    Serial.print(bmp.pressure());
    Serial.println(" Pa");
    
    Serial.print("Altitude: ");
    Serial.print(bmp.altitude(),2);
    Serial.println(" m\n");
}
Exemplo n.º 2
0
//------------------------------------------------------------------------------
// Setup Function - Initializes Arduino
//------------------------------------------------------------------------------
void setup()
{
    pinMode(13, OUTPUT);

    Serial.begin(9600);
    bmp.initialize();

    // Initial
    Serial.println("Initial Reading");
    Serial.print("Temperature: ");
    Serial.print(bmp.temperature(),2);
    Serial.println(" deg C");
    
    Serial.print("Pressure: ");
    Serial.print(bmp.pressure());
    Serial.println(" Pa");
    
    Serial.print("Altitude: ");
    Serial.print(bmp.altitude(),2);
    Serial.println(" m\n");
    
    
    // Set with current pressure
    bmp.calibrateWithPres(101681);
    
    Serial.println("Set with current pressure of 101681");
    Serial.print("Temperature: ");
    Serial.print(bmp.temperature(),2);
    Serial.println(" deg C");
    
    Serial.print("Pressure: ");
    Serial.print(bmp.pressure());
    Serial.println(" Pa");
    
    Serial.print("Altitude: ");
    Serial.print(bmp.altitude(),2);
    Serial.println(" m\n");
    
    // Set with current altitude
    bmp.calibrateWithAlt(270);
    
    Serial.println("Set with current altitude of 270");
    Serial.print("Temperature: ");
    Serial.print(bmp.temperature(),2);
    Serial.println(" deg C");
    
    Serial.print("Pressure: ");
    Serial.print(bmp.pressure());
    Serial.println(" Pa");
    
    Serial.print("Altitude: ");
    Serial.print(bmp.altitude(),2);
    Serial.println(" m\n");
    
    // Set OSS to 3
    bmp.setOSS(3);
    
    Serial.println("Set with OSS to 3");
    Serial.print("Temperature: ");
    Serial.print(bmp.temperature(),2);
    Serial.println(" deg C");
    
    Serial.print("Pressure: ");
    Serial.print(bmp.pressure());
    Serial.println(" Pa");
    
    Serial.print("Altitude: ");
    Serial.print(bmp.altitude(),2);
    Serial.println(" m\n");
}