Created
January 16, 2023 19:03
-
-
Save vlazar-/16ef36b90e97223d223ddd5318d3cd41 to your computer and use it in GitHub Desktop.
BMP180 Funkcije
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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