configuration.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef INCLUDE_CONFIGURATION_H_
  2. #define INCLUDE_CONFIGURATION_H_
  3. #include <user_config.h>
  4. #include <SmingCore/SmingCore.h>
  5. // If you want, you can define WiFi settings globally in Eclipse Environment Variables
  6. #ifndef WIFI_SSID
  7. #define WIFI_SSID "Heaven-WiFi" // Put you SSID and Password here
  8. #define WIFI_PWD "Heaven-32847"
  9. #endif
  10. // Pin for communication with DHT sensor
  11. #define DHT_PIN 2
  12. // Pin for trigger control output
  13. #define CONTROL_PIN 16
  14. #define METEO_CONFIG_FILE ".meteo.conf" // leading point for security reasons :)
  15. enum TriggerType
  16. {
  17. eTT_None = 0,
  18. eTT_Temperature,
  19. eTT_Humidity
  20. };
  21. struct MeteoConfig
  22. {
  23. MeteoConfig()
  24. {
  25. AddT = 0;
  26. AddRH = 0;
  27. AddTZ = 2;
  28. Trigger = eTT_Humidity;
  29. RangeMin = 30;
  30. RangeMax = 50;
  31. }
  32. String NetworkSSID;
  33. String NetworkPassword;
  34. float AddT; // Temperature adjustment
  35. float AddRH; // Humidity adjustment
  36. float AddTZ; // TimeZone - local time offset
  37. TriggerType Trigger; // Sensor trigger type
  38. float RangeMin;
  39. float RangeMax;
  40. };
  41. MeteoConfig loadConfig();
  42. void saveConfig(MeteoConfig& cfg);
  43. extern MeteoConfig ActiveConfig;
  44. #endif /* INCLUDE_CONFIGURATION_H_ */