NEW: #1 Mysql support, makefile and readme update, sensor struct update
This commit is contained in:
9
main.c
9
main.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user