Skip to content

Instantly share code, notes, and snippets.

@vlazar-
Created January 16, 2023 19:03
Show Gist options
  • Save vlazar-/16ef36b90e97223d223ddd5318d3cd41 to your computer and use it in GitHub Desktop.
Save vlazar-/16ef36b90e97223d223ddd5318d3cd41 to your computer and use it in GitHub Desktop.
BMP180 Funkcije
double ocitajTlak() {
char status;
/*
* definiramo varijable:
* temp - temperatura zraka
* Tlak - tlak zraka
* tlak0 - tlak na povrsini mora
* nadVisina - nadmorska visina
*/
double temp, Tlak, tlak0, nadVisina;
status = bmp180.startTemperature();
if (status != 0) {
delay(status);
status = bmp180.getTemperature(temp);
if (status != 0) {
status = bmp180.startPressure(3);
if (status != 0) {
delay(status);
status = bmp180.getPressure(Tlak, temp);
if (status != 0) {
return (Tlak);
}
}
}
}
}
double ocitajTemperaturu() {
char status;
double temp;
status = bmp180.startTemperature();
if (status != 0) {
delay(status);
status = bmp180.getTemperature(temp);
if (status != 0) {
return (temp);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment