Actually write bmp180 / bmp085 testcase

master
Richard Meadows 2015-10-01 15:24:28 +01:00
rodzic b2e58bc4a5
commit ef3d232a90
2 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -2,6 +2,9 @@
#define __verification__
#endif
#include "samd20.h"
#include "bmp180.h"
/****************************//* pressure_temperature_tc *//****************************/
/**
* 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
* 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;
}

Wyświetl plik

@ -38,4 +38,11 @@ class pressure_temperature_tc:
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