#ifndef Spm4648_h #define Spm4648_h #include "Arduino.h" #define CHANNELS 10 #define MINVAL 306 #define MAXVAL 1738 #define MAXSTEP ((MAXVAL-MINVAL) / 10) class Spm4648 { public: Spm4648(void); void read(Stream &port); float getVal(byte x); void listVal(); bool hasData(); bool isConnected(); float data[5]; uint8_t ids[CHANNELS]; uint16_t vals[CHANNELS]; uint8_t idCount = 0; bool newData; private: void parse(); void setVal(byte x, uint16_t val); uint8_t p = 0; uint32_t timeout; static const char length = 16; uint8_t buf[length]; }; #endif