I want to connect the pressure sensor to the Artemis Nano board via i2c, and then connect the board to the PC via USB to see the sensor value in the PC Modbus-program.
So I installed the library below.
https://github.com/smarmengol/Modbus-Ma ... or-Arduino
When selecting a sample code(simple_slave) and compiling, if I select the Arduino-Uno board, the compiling is successful. However, if I select the Artemis Nano, an error occurs as below.
\.arduinoIDE-unsaved2024524-18368-g9n6y1.16eyt\simple_slave\simple_slave.ino:14:64: error: narrowing conversion of '-1' from 'int' to 'uint16_t' {aka 'short unsigned int'} inside { } [-Wnarrowing]
3, 1415, 9265, 4, 2, 7182, 28182, 8, 0, 0, 0, 0, 0, 0, 1, -1 };
^
Using library Modbus-Master-Slave-for-Arduino-master in folder: C:\Users\ff\Downloads\Arduino\libraries\Modbus-Master-Slave-for-Arduino-master (legacy)
exit status 1
Compilation error: narrowing conversion of '-1' from 'int' to 'uint16_t' {aka 'short unsigned int'} inside { } [-Wnarrowing]
How do I solve this?
I don't necessarily have to use this library.
The important thing is to transmit the sensor value to the PC via the Modbus-RS485 protocol via USB.
So I installed the library below.
https://github.com/smarmengol/Modbus-Ma ... or-Arduino
When selecting a sample code(simple_slave) and compiling, if I select the Arduino-Uno board, the compiling is successful. However, if I select the Artemis Nano, an error occurs as below.
\.arduinoIDE-unsaved2024524-18368-g9n6y1.16eyt\simple_slave\simple_slave.ino:14:64: error: narrowing conversion of '-1' from 'int' to 'uint16_t' {aka 'short unsigned int'} inside { } [-Wnarrowing]
3, 1415, 9265, 4, 2, 7182, 28182, 8, 0, 0, 0, 0, 0, 0, 1, -1 };
^
Using library Modbus-Master-Slave-for-Arduino-master in folder: C:\Users\ff\Downloads\Arduino\libraries\Modbus-Master-Slave-for-Arduino-master (legacy)
exit status 1
Compilation error: narrowing conversion of '-1' from 'int' to 'uint16_t' {aka 'short unsigned int'} inside { } [-Wnarrowing]
How do I solve this?
I don't necessarily have to use this library.
The important thing is to transmit the sensor value to the PC via the Modbus-RS485 protocol via USB.
Statistics: Posted by Benscoffee — Mon Jun 24, 2024 9:10 am