kopia lustrzana https://github.com/bristol-seds/pico-tracker
Actually write bmp180 / bmp085 testcase
rodzic
b2e58bc4a5
commit
ef3d232a90
|
@ -2,6 +2,9 @@
|
||||||
#define __verification__
|
#define __verification__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "samd20.h"
|
||||||
|
#include "bmp180.h"
|
||||||
|
|
||||||
/****************************//* pressure_temperature_tc *//****************************/
|
/****************************//* pressure_temperature_tc *//****************************/
|
||||||
/**
|
/**
|
||||||
* Write a description of your test case here
|
* Write a description of your test case here
|
||||||
|
@ -30,5 +33,8 @@ __verification__ void pressure_temperature_tc(void) {
|
||||||
* Use the input parameters to run the test case. Populate the
|
* Use the input parameters to run the test case. Populate the
|
||||||
* results structure at the end
|
* results structure at the end
|
||||||
*/
|
*/
|
||||||
|
struct barometer* b = get_barometer();
|
||||||
|
|
||||||
|
pressure_temperature_tc_results.pressure = (float)b->pressure;
|
||||||
|
pressure_temperature_tc_results.temperature = (float)b->temperature;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,4 +38,11 @@ class pressure_temperature_tc:
|
||||||
Can use print_info
|
Can use print_info
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
pressure = result['pressure']
|
||||||
|
temperature = result['temperature']
|
||||||
|
|
||||||
|
print_info("Pressure: {:.1f} Pa, Temperature: {:.2f} degC".format(
|
||||||
|
float(pressure), float(temperature)))
|
||||||
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
Ładowanie…
Reference in New Issue