#include <LCD5110_Graph.h> #include "DHT.h" #include <Wire.h> #include <BMP085.h> #include "RTClib.h" #define DHTPIN 10 // 10 pin DHT22 #define DHTTYPE DHT22 RTC_DS1307 RTC; BMP085 dps = BMP085(); DHT dht(DHTPIN, DHTTYPE); long temp3 = 0, Pressure = 0, Altitude = 0; // pin 3 - Serial clock out (SCLK) // pin 4 - Serial data out (DIN) // pin 5 - Data/Command select (D/C) // pin 7 - LCD chip select (CS) // pin 6 - LCD reset (RST) LCD5110 myGLCD(3, 4, 5, 6, 7); extern unsigned char SmallFont[]; void setup() { myGLCD.InitLCD(); myGLCD.setFont(SmallFont); Wire.begin(); RTC.begin(); dht.begin(); delay(2000); dps.init(MODE_ULTRA_HIGHRES, 3200, true); // 3200 32 ( + ) } void loop() { dps.getPressure(&Pressure); dps.getAltitude(&Altitude); dps.getTemperature(&temp3); DateTime now = RTC.now(); // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) float h = dht.readHumidity(); // Read temperature as Celsius float t = dht.readTemperature(); myGLCD.setFont(SmallFont); // myGLCD.clrScr(); // myGLCD.print("Time=", LEFT, 0); // myGLCD.printNumI(int(now.hour()), 32, 0); // 32,0 32= , . 0= myGLCD.print(":", 45, 0); myGLCD.printNumI(int(now.minute()), 50, 0); myGLCD.print(":", 62, 0); myGLCD.printNumI(int(now.second()), 67, 0); myGLCD.print("Date=", LEFT, 10); // myGLCD.printNumI(int(now.day()), 32, 10); myGLCD.print("/", 44, 10); myGLCD.printNumI(int(now.month()), 50, 10); myGLCD.print("/", 62, 10); myGLCD.printNumI(int(now.year() - 2000), 68, 10); myGLCD.print("T=", LEFT, 20); // myGLCD.printNumF(t, 2, 13, 20); // DHT22 myGLCD.print("/", 45, 20); myGLCD.printNumF(temp3 * 0.1, 2, 53, 20); // myGLCD.print("Hum=", LEFT, 30); // DHT22 myGLCD.printNumF(h, 2, 28, 30); myGLCD.print("%", 63, 30); myGLCD.print("Pres=", LEFT, 40); // myGLCD.printNumF(Pressure / 133.3, 2, 31, 40); // myGLCD.print("mm", 68, 40); // Serial.print(" Alt(m):"); , // Serial.print(Altitude / 100); myGLCD.update(); // delay (1000); // 1 }