ElectronicCats / CayenneLPP

Library for Arduino compatible with Cayenne Low Power Payload
http://electroniccats.com/
MIT License
106 stars 48 forks source link

Add Generic Sensor, Voltage and Percentage data formats #4

Closed gmag11 closed 4 years ago

gmag11 commented 5 years ago

I've added these three formats that are maybe useful. Please check that conversion method from float to binary buffer is ok for you. I'm using pointers to do the job. I don't know how to do float to buffer conversion using shifts.

Both formats are float, that should be transmitted with big endianness. I'm working on ESP8266 and ESP32 platforms, that use little endianness. They define BYTE_ORDER as LITTLE_ENDIAN , but I've not found any definition like that on Arduino platform, although it uses little endianness too. Then I've considered that if ARDUINO is defined endianness is little.

sabas1080 commented 4 years ago

thanks @gmag11 add data types in pullrequest #5