1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/projects/laser/main.c
Oliver Hahm 3622d83ea9 [board msba2]
* fixed header guards

[drivers ltc4150]
* added joule conversion
2011-03-04 16:46:20 +01:00

34 lines
826 B
C

#include <stdio.h>
#include <sht11.h>
#include <board.h>
#include <swtimer.h>
#include <ltc4150.h>
int main(void)
{
sht11_val_t sht11_val;
double mAh = 0;
uint8_t success = 0;
puts("");
puts("LaSeR: Longterm Sensor Reader initialized.");
puts("Printing \"temperature in °C;relative humidity;temperature compensated relative humidity\".");
puts("");
ltc4150_start();
while (1) {
success = sht11_read_sensor(&sht11_val, HUMIDITY|TEMPERATURE);
mAh = ltc4150_get_total_mAh();
if (!success) {
printf("error;error;error\n");
}
else {
printf("%.2f;%.2f;%.2f;%.2f\n", sht11_val.temperature, sht11_val.relhum, sht11_val.relhum_temp, mAh);
}
LED_RED_TOGGLE;
swtimer_usleep(60 * 1000*1000);
}
}