Some cosmetics
This commit is contained in:
		| @@ -1,9 +1,9 @@ | ||||
| #include <SD.h> | ||||
| #include <Wire.h> | ||||
| #include "BMP085.h" | ||||
| #include "Chronodot.h" | ||||
| #include "DHT.h" | ||||
| #include "TSL2561.h" | ||||
| #include "Chronodot.h" | ||||
|  | ||||
| #define TIMING  1000 // milliseconds | ||||
| #define DHTPIN  2 | ||||
| @@ -18,7 +18,6 @@ File    file; | ||||
|  | ||||
| void setup() { | ||||
|     Serial.begin(9600); | ||||
|     pinMode(5, OUTPUT); | ||||
|  | ||||
|     //----- SD Card | ||||
|     Serial.println("INIT SD Card"); | ||||
| @@ -33,9 +32,9 @@ void setup() { | ||||
|     Serial.println("INIT Sensors"); | ||||
|  | ||||
|     bmp.begin(); | ||||
|     chronodot.begin(); | ||||
|     dht.begin(); | ||||
|     tsl.begin(); | ||||
|     chronodot.begin(); | ||||
|  | ||||
|     // You can change the gain on the fly, to adapt to brighter/dimmer light situations | ||||
|     //tsl.setGain(TSL2561_GAIN_0X);         // set no gain (for bright situtations) | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| #include <Wire.h> | ||||
| #include <SPI.h> | ||||
| #include <Ethernet.h> | ||||
| #include "WebServer.h" | ||||
| #include "BMP085.h" | ||||
| #include "Chronodot.h" | ||||
| #include "DHT.h" | ||||
| #include "TSL2561.h" | ||||
| #include "Chronodot.h" | ||||
| #include "WebServer.h" | ||||
|  | ||||
| #define TIMEZONE        7200 // 2 hours | ||||
| #define DHTPIN          2 | ||||
| @@ -34,9 +34,9 @@ inline Print &operator <<(Print &obj, T arg) | ||||
| { obj.print(arg); return obj; } | ||||
|  | ||||
| BMP085    bmp; | ||||
| Chronodot chronodot; | ||||
| DHT       dht(DHTPIN, DHTTYPE); | ||||
| TSL2561   tsl(TSL2561_ADDR_FLOAT); | ||||
| Chronodot chronodot; | ||||
| WebServer webserver(PREFIX, 80); | ||||
|  | ||||
| byte packetBuffer[ NTP_PACKET_SIZE]; | ||||
| @@ -52,8 +52,6 @@ void sensorsJsonCmd(WebServer &server, WebServer::ConnectionType type, char *url | ||||
|     int32_t pressure    = bmp.readPressure(); | ||||
|     float   altitude    = bmp.readAltitude(); | ||||
|  | ||||
|     float humidity = dht.readHumidity(); | ||||
|  | ||||
|     uint32_t lum = tsl.getFullLuminosity(); | ||||
|     uint16_t lightIr   = lum >> 16; | ||||
|     uint16_t lightFull = lum & 0xFFFF; | ||||
| @@ -72,6 +70,7 @@ void sensorsJsonCmd(WebServer &server, WebServer::ConnectionType type, char *url | ||||
|         << "] }"; | ||||
| } | ||||
|  | ||||
| // Taken from http://arduino.cc/en/Tutorial/UdpNtpClient . | ||||
| void sendNTPpacket() { | ||||
|     // set all bytes in the buffer to 0 | ||||
|     memset(packetBuffer, 0, NTP_PACKET_SIZE); | ||||
| @@ -119,8 +118,6 @@ void sendNTPpacket() { | ||||
|  | ||||
| void setup() { | ||||
|     Serial.begin(9600); | ||||
|     pinMode(5, OUTPUT); | ||||
|     SPI.begin(); | ||||
|  | ||||
|     //----- Ethernet/WebServer | ||||
|     Serial.println("INIT Ethernet"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user