1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00
RIOT/projects/laser/main.c

34 lines
826 B
C
Raw Normal View History

2010-11-18 16:47:04 +01:00
#include <stdio.h>
#include <sht11.h>
#include <board.h>
#include <swtimer.h>
2010-11-24 11:08:15 +01:00
#include <ltc4150.h>
2010-11-18 16:47:04 +01:00
int main(void)
{
sht11_val_t sht11_val;
2011-07-10 22:49:41 +02:00
double mAh = 0;
2010-11-18 16:47:04 +01:00
uint8_t success = 0;
puts("");
puts("LaSeR: Longterm Sensor Reader initialized.");
puts("Printing \"temperature in °C;relative humidity;temperature compensated relative humidity\".");
puts("");
2010-11-24 11:08:15 +01:00
ltc4150_start();
2010-11-18 16:47:04 +01:00
while (1) {
success = sht11_read_sensor(&sht11_val, HUMIDITY|TEMPERATURE);
2011-07-10 22:49:41 +02:00
mAh = ltc4150_get_total_mAh();
2010-11-18 16:47:04 +01:00
if (!success) {
printf("error;error;error\n");
}
else {
2011-07-10 22:49:41 +02:00
printf("%.2f;%.2f;%.2f;%.2f\n", sht11_val.temperature, sht11_val.relhum, sht11_val.relhum_temp, mAh);
2010-11-18 16:47:04 +01:00
}
LED_RED_TOGGLE;
2010-11-24 11:08:15 +01:00
swtimer_usleep(60 * 1000*1000);
2010-11-18 16:47:04 +01:00
}
}