20 #ifndef AnimatSerial_h
21 #define AnimatSerial_h
23 #include "HardwareSerial.h"
29 #define MAX_ANIMAT_BUFFER 128
31 #define PACKET_INFO_SIZE 6 //Size of the header, packet size, message id, and checksum in bytes
32 #define START_MESSAGE_INFO_BYTE 5
39 unsigned char bval[2];
44 unsigned char bval[4];
62 AnimatSerial(HardwareSerial *ss,
unsigned int inTotal,
unsigned int outTotal);
65 void begin(
unsigned long baud);
69 void writeResendMsg();
72 bool isChanged(
unsigned int id);
73 bool getData(
unsigned int index,
AnimatData &data);
74 bool addData(
unsigned int id,
float val);
76 unsigned int getInDataTotal() {
return inDataTotal;}
77 unsigned int getOutDataTotal() {
return outDataTotal;}
83 void setInDataValue(
int id,
float val);
93 unsigned int inDataTotal;
94 unsigned int outDataTotal;
96 unsigned int inDataCount;
97 unsigned int outDataCount;
100 unsigned char vals[MAX_ANIMAT_BUFFER];
103 unsigned char status;
109 unsigned char bval[2];
114 unsigned char bval[2];
119 unsigned char bval[4];
123 HardwareSerial *stream;