smarmengol / Modbus-Master-Slave-for-Arduino

Modbus Master-Slave library for Arduino
GNU Lesser General Public License v2.1
473 stars 328 forks source link

unsigned data type but negative value #54

Open stuartpittaway opened 4 years ago

stuartpittaway commented 4 years ago

In your example https://github.com/smarmengol/Modbus-Master-Slave-for-Arduino/blob/master/examples/RS485_slave/RS485_slave.ino

The array is defined as uint16 but you have a negative entry at the end of the array, throws a compiler error/warning.

uint16_t au16data[16] = { 3, 1415, 9265, 4, 2, 7182, 28182, 8, 0, 0, 0, 0, 0, 0, 1, -1 };