mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
[projects WEAtHeR]
* added project
This commit is contained in:
parent
23cd123bdb
commit
c0af1a8189
5
projects/WEAtHeR/Jamfile
Normal file
5
projects/WEAtHeR/Jamfile
Normal file
@ -0,0 +1,5 @@
|
||||
SubDir TOP projects weather ;
|
||||
|
||||
Module weather : main.c : sht11 ltc4150 swtimer auto_init ;
|
||||
|
||||
UseModule weather ;
|
||||
33
projects/WEAtHeR/main.c
Normal file
33
projects/WEAtHeR/main.c
Normal file
@ -0,0 +1,33 @@
|
||||
#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("WEAtHeR: Wireless Energy-Aware mulTi-Hop sEnsor Reading.");
|
||||
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);
|
||||
}
|
||||
}
|
||||
13
projects/WEAtHeR/tests/hello-world
Executable file
13
projects/WEAtHeR/tests/hello-world
Executable file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/expect
|
||||
|
||||
set timeout 5
|
||||
|
||||
spawn pseudoterm $env(PORT)
|
||||
|
||||
expect {
|
||||
"Hello World!" {}
|
||||
timeout { exit 1 }
|
||||
}
|
||||
|
||||
puts "\nTest successful!\n"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user