41 #include "dev/batv-sensor.h"
46 if(x>=0.0f)
return (
float) ((int)x);
47 else return (
float) ((int)x-1);
52 PROCESS(test_batv_process,
"Testing Batv measurementin Z1 Feshie");
53 AUTOSTART_PROCESSES(&test_batv_process);
61 SENSORS_ACTIVATE(batv_sensor);
64 uint16_t value = batv_sensor.value(0);
65 float voltage = (float)value / 273;
66 printf(
"Batv Value: %i\n", value);
67 printf(
"Approx Voltage: %ld.%02d\n", (
long)voltage, (voltage - floor(voltage))*100 );
70 SENSORS_DEACTIVATE(batv_sensor);
#define PROCESS_END()
Define the end of a process.
#define PROCESS(name, strname)
Declare a process.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_BEGIN()
Define the beginning of a process.