From 2a10b67fe2313919098b9127f6f23f5e3e0f3b35 Mon Sep 17 00:00:00 2001 From: Ronald Schaten Date: Wed, 18 May 2016 09:42:06 +0200 Subject: [PATCH] added hardware configuration for witty with DHT22 --- things/HardwareWittyDht.h | 37 +++++++++++++++++++++++++++++++++++++ things/things.ino | 1 + 2 files changed, 38 insertions(+) create mode 100644 things/HardwareWittyDht.h diff --git a/things/HardwareWittyDht.h b/things/HardwareWittyDht.h new file mode 100644 index 0000000..2394c0b --- /dev/null +++ b/things/HardwareWittyDht.h @@ -0,0 +1,37 @@ +/* + * Witty Cloud + * development board, featuring RGB LED, LDR and a button + * added hardware: DHT22 temperature and humidity sensor + * + * Settings in IDE: + * - Board: "WeMos D1 R2 & mini" + */ + +#include "DeviceRgb.h" +#include "DeviceLdr.h" +#include "DeviceButton.h" +#include "DeviceDht.h" + +const char* FWNAME = "things@WittyDht"; + +const byte PIN_RGB_RED = D8; +const byte PIN_RGB_GREEN = D6; +const byte PIN_RGB_BLUE = D7; +DeviceRgb deviceRgb(PIN_RGB_RED, PIN_RGB_GREEN, PIN_RGB_BLUE); + +const byte PIN_LDR = A0; +DeviceLdr deviceLdr(PIN_LDR); + +const byte PIN_BUTTON = D2; +DeviceButton deviceButton(PIN_BUTTON); + +const byte PIN_DHT = D5; +const byte TYPE_DHT = DHT22; +DeviceDht deviceDht(PIN_DHT, TYPE_DHT); + +Device* devices[] = { + &deviceRgb, + &deviceLdr, + &deviceButton, + &deviceDht, +}; diff --git a/things/things.ino b/things/things.ino index 6e9f1f6..2005b91 100644 --- a/things/things.ino +++ b/things/things.ino @@ -1,6 +1,7 @@ #include // https://github.com/marvinroger/homie-esp8266 #include "HardwareWitty.h" +//#include "HardwareWittyDht.h" //#include "HardwareH801wifi.h" const char* FWVERSION = "1.0.0";