ESP12F.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #ifndef __ESP12f_H__
  2. #define __ESP12f_H__
  3. #include <ESP8266WiFi.h>
  4. #include <BlynkSimpleEsp8266.h>
  5. #include <WidgetRTC.h>
  6. #define SIZEMES 8
  7. #define ESP_OK 0
  8. #define ESP_NOK 1
  9. #define MASKMES 0XF0
  10. #define MASKERR 0x03
  11. #define STATUS 0x00
  12. #define READACTI 0x10
  13. #define WRITACTI 0x20
  14. #define READVENT 0x30
  15. #define WRITVENT 0x40
  16. #define ERRORR 0x50
  17. #define RESERVE2 0x60
  18. #define DELAYBRA 0x70
  19. #define SYNCRTC 0x80
  20. #define ACTIREM 0x01
  21. #define ACTIECU 0x02
  22. #define ACTICHA 0x04
  23. #define ACTIBGE 0x08
  24. #define ACTIBR2 0x10
  25. #define ACTIBR1 0x20
  26. #define ACTI0SO 0x40 //osmolation (auto)
  27. #define ACTINOU 0x80
  28. #define ACTILUM 0x01
  29. #define ACTIOSM 0x02 //Osmolation manuel
  30. #define DECALNOUR 7
  31. #define DECALOSMO 6
  32. #define DECALBRA1 5
  33. #define DECALBRA2 4
  34. #define DECALBRAG 3
  35. #define DECALCHAU 2
  36. #define DECALECUM 1
  37. #define DECALREME 0
  38. #define DECALLUM 0
  39. #define DECALOSMM 1
  40. /* **************************************************************
  41. * Structur
  42. ***************************************************************/
  43. /* **************************************************************
  44. * Variable Connection
  45. ***************************************************************/
  46. // Token identification
  47. char auth[] = "Gnqfc0WujzKYuFVFSpOgzy0YqSMyPDaL";
  48. // Your WiFi credentials.
  49. char ssid[] = "Livebox-7C2C";
  50. char pass[] = "566C61F61F9C925C9F3D7D79E6";
  51. /* **************************************************************
  52. * Variable Global
  53. ***************************************************************/
  54. //BlynkTimer timerRTC;
  55. BlynkTimer timerStatus;
  56. BlynkTimer timerRTC;
  57. WidgetRTC rtc;
  58. WidgetLED TechBas(V0);
  59. WidgetLED TechHau(V1);
  60. WidgetLED CuveHau(V2);
  61. WidgetLED Reserve(V3);
  62. /* **************************************************************
  63. * Fonction Perso
  64. ***************************************************************/
  65. void SyncRTC();
  66. void Status();
  67. uint8_t transmition(uint8_t *in, uint8_t nbTr, uint8_t *out);
  68. float convTemp(uint8_t ent);
  69. float convPH(uint8_t ent);
  70. int convSalinity(uint8_t ent);
  71. uint8_t readStatus();
  72. uint8_t readAction();
  73. uint8_t readVentil();
  74. #endif