ESP12F.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 MASKMES 0XF0
  8. #define STATUS 0x00
  9. #define READACTI 0x10
  10. #define WRITACTI 0x20
  11. #define READVENT 0x30
  12. #define WRITVENT 0x40
  13. #define ERRORR 0x50
  14. #define RESERVE2 0x60
  15. #define DELAYBRA 0x70
  16. #define SYNCRTC 0x80
  17. #define ACTIREM 0x01
  18. #define ACTIECU 0x02
  19. #define ACTICHA 0x04
  20. #define ACTIBGE 0x08
  21. #define ACTIBR1 0x10
  22. #define ACTIBR2 0x20
  23. #define ACTIOSM 0x40
  24. #define ACTINOU 0x80
  25. #define DECALNOUR 7
  26. #define DECALOSMO 6
  27. #define DECALBRA1 5
  28. #define DECALBRA2 4
  29. #define DECALBRAG 3
  30. #define DECALCHAU 2
  31. #define DECALECUM 1
  32. #define DECALREME 0
  33. /* **************************************************************
  34. * Structur
  35. ***************************************************************/
  36. /* **************************************************************
  37. * Variable Connection
  38. ***************************************************************/
  39. // Token identification
  40. char auth[] = "0ZwJfFhynzpNIgpPsEezRpVsGM9GM7zu";
  41. // Your WiFi credentials.
  42. char ssid[] = "Livebox-7C2C";
  43. char pass[] = "566C61F61F9C925C9F3D7D79E6";
  44. /* **************************************************************
  45. * Variable Global
  46. ***************************************************************/
  47. //BlynkTimer timerRTC;
  48. BlynkTimer timerStatus;
  49. BlynkTimer timerRTC;
  50. WidgetRTC rtc;
  51. WidgetLED TechBas(V0);
  52. WidgetLED TechHau(V1);
  53. WidgetLED CuveHau(V2);
  54. WidgetLED Reserve(V3);
  55. /* **************************************************************
  56. * Fonction Perso
  57. ***************************************************************/
  58. uint8_t uart_send(uint8_t *in, uint8_t nbTr, uint8_t *out); // envoie un message et recoie la reponce
  59. uint8_t transmition(uint8_t *in, uint8_t nbTr, uint8_t *out); // reesai si probleme dans le message;
  60. void SyncRTC();
  61. float convTemp(uint8_t ent);
  62. float convPH(uint8_t ent);
  63. int convSalinity(uint8_t ent);
  64. void Status();
  65. #endif