1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

* added LaSeR project

This commit is contained in:
Kaspar Schleiser 2010-11-18 16:47:04 +01:00
parent 440c6fac8d
commit 17e41bae13
2 changed files with 32 additions and 0 deletions

5
projects/laser/Jamfile Normal file
View File

@ -0,0 +1,5 @@
SubDir TOP projects laser ;
Module laser : main.c : sht11 swtimer auto_init ;
UseModule laser ;

27
projects/laser/main.c Normal file
View File

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