Advertisement
Guest User

Untitled

a guest
Jan 27th, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.24 KB | None | 0 0
  1. /*
  2.  JETI_EX_SENSOR.h, Version 0.1
  3.  Mars 2012, by Denis Artru
  4.  alarm and jetibox display are based on work of Uwe Gartmann and Alexander Buschek
  5.  written for Arduino MEGA using rx2/tx2
  6.  
  7.  JETI_EX_SENSOR.h, Version 0.2
  8.  2014, by DevFor8.com, info@devfor8.com
  9.  modified for more items (15max)
  10.  modified for external sending (software serial can be used)
  11.  various fixes
  12. */
  13.  
  14. #ifndef JETI_EX_SENSOR_h
  15. #define JETI_EX_SENSOR_h
  16. #include <inttypes.h>
  17. #include <Arduino.h>
  18.  
  19. #define JETI_SENSOR_ID1 0x15
  20. #define JETI_SENSOR_ID2 0xA4
  21. #define JETI_SENSOR_ID3 0xAC
  22. #define JETI_SENSOR_ID4 0x07
  23.  
  24. #define LCDMaxPos 32
  25.  
  26. #define JB_key_none     0b0000
  27. #define JB_key_up       0b0010
  28. #define JB_key_right    0b0001
  29. #define JB_key_down     0b0100
  30. #define JB_key_left     0b1000
  31.  
  32. class JETI_Box_class {
  33. private:
  34.     int nbValueEX;
  35.     const __FlashStringHelper * nameEX[16]; //zmenit na odkazy do PROGMEM
  36.     const __FlashStringHelper * unitEX[16]; //zmenit na odkazy do PROGMEM
  37.     uint8_t precisionEX[16]; /* 0 int; 1,2,3 float; 4 date, 5 time, 6 GPS*/ //zmenit na odkazy do PROGMEM
  38.     int* valueEX[16];
  39.     char alarmEX;
  40.     uint8_t valueEXToSend;
  41. public:
  42.     uint8_t frame[180];
  43.     int middle_bit9; //todle zmenime - false je pro prvni a posledni byte a pak pro byte uprostred mezi Ex datama a textama. Tj. staci nam znat offset tohodle a usetrime 64 bytes
  44.     uint8_t frameSize;
  45.    JETI_Box_class();
  46.    void Init(const __FlashStringHelper* sensorName);
  47.     uint8_t addData(const __FlashStringHelper* name, const __FlashStringHelper* unit);
  48.     void setValue(uint8_t ident, short* valuePtr);
  49.     void setValue(uint8_t ident, volatile float* valuePtr, uint8_t precision);
  50.     void setValueBig(uint8_t ident, int*); // Added by Tero
  51.     void setValueTime(uint8_t ident, uint8_t[3]);
  52.     void setValueDate(uint8_t ident, uint8_t[3]);
  53.     void setValueGPS(uint8_t ident, uint8_t[4]); /* [0] NESW , [1] angle, [2][3] minute/1000*/
  54.     void unsetValue(uint8_t ident);
  55.     void JetiBox(const __FlashStringHelper* line1, const __FlashStringHelper* line2);
  56.     void JetiBox(const char* line1, const char* line2);
  57.     void JetiBox(const char* line);
  58.     bool createFrame(uint8_t sendheader);
  59.     void alarm(char alarmLetter);
  60.     uint8_t readbuttons();
  61. };
  62. //extern JETI_Box_class JB;
  63. extern uint8_t sensorFrameName;
  64. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement