NEW: #1 Mysql support, makefile and readme update, sensor struct update

This commit is contained in:
2017-01-28 13:56:47 +01:00
parent 2167638d2b
commit c8182dafec
7 changed files with 104 additions and 10 deletions

9
main.c
View File

@@ -3,6 +3,8 @@
#include "dht22.h"
#include <stdlib.h>
#include <unistd.h>
#include "sendmysql.h"
int main(void) {
if (wiringPiSetup () == -1)
exit(EXIT_FAILURE) ;
@@ -14,8 +16,11 @@ int main(void) {
}
sensor data;
getData(7, &data);
data.pin = 7;
getData(&data);
printf("%.2f, %.2f\n", data.temperature, data.humidity);
insertData(&data);
return 0;
}