I was trying out version teensy sketch 5.1 and ran into: C:\Users\assis\Desktop\5.1 AR4\AR4_teensy41_sketch_v5.1\AR4_teensy41_sketch_v5.1.ino:69:10: fatal error: ModbusMaster.h: No such file or directory
69 | #include <ModbusMaster.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: ModbusMaster.h: No such file or directory
You first need to install the corresponding library files for your Arduino.
ModbusMaster.h
@goto_2004 is correct. If you navigate to Tools / Manage Libraries and install ModbusMaster you will be able to install the sketch. I have also added details about this in the manual in the Modbus chapter. Let me know if you have any questions.
I got also an Error: WARNING: library ArduinoModbus claims to run on megaavr, samd, mbed_nano, mbed_portenta, mbed_opta architecture(s) and may be incompatible with your current board which runs on avr architecture(s).
WARNING: library ArduinoRS485 claims to run on samd, mbed_portenta, mbed_opta, mbed_nano, renesas_uno architecture(s) and may be incompatible with your current board which runs on avr architecture(s).
In file included from c:\Users\gv\Documents\Arduino\libraries\ModbusMaster\src/ModbusMaster.h:58,
from D:\AR4_teensy41_sketch_v5.1\AR4_teensy41_sketch_v5.1.ino:71:
c:\Users\gv\Documents\Arduino\libraries\ModbusMaster\src/util/crc16.h:71:17: warning: 'uint16_t crc16_update(uint16_t, uint8_t)' defined but not used [-Wunused-function]
71 | static uint16_t crc16_update(uint16_t crc, uint8_t a)
| ^~~~~~~~~~~~
c:\Users\gv\Documents\Arduino\libraries\ModbusMaster\src\ModbusMaster.cpp: In member function 'uint8_t ModbusMaster::requestFrom(uint16_t, uint16_t)':
c:\Users\gv\Documents\Arduino\libraries\ModbusMaster\src\ModbusMaster.cpp:94:27: warning: 'read' is used uninitialized [-Wuninitialized]
94 | _u8ResponseBufferLength = read;
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
Opening Teensy Loader...
Memory Usage on Teensy 4.1:
FLASH: code:204064, data:18376, headers:8980 free for files:7895044
RAM1: variables:23200, code:201352, padding:28024 free for local variables:271712
RAM2: variables:12416 free for malloc/new:511872 Please help Guenter
Yes for some reason the Modbus master library sends a few "defined but not used [-Wunused-function]" warnings. I have not been able to resolve the warnings but they are just warnings and the Modbus master library functions as intended. It also runs fine on the teensy boards. Let me know if any of these are preventing you from running.