fleaplc
September 25, 2022, 6:28pm
1
I have a code I'm using woth Mega board and works fine, If I move to Arduino zero , the same library return these errors (Arduino Modbus library)
..\Documents\Arduino\libraries\ArduinoRS485\src\RS485.h:35:30: error: 'A6' was not declared in this scope
*.\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:191:62: note: in expansion of macro 'RS485_DEFAULT_DE_PIN'
RS485Class RS485(SERIAL_PORT_HARDWARE, RS485_DEFAULT_TX_PIN, RS485_DEFAULT_DE_PIN, RS485_DEFAULT_RE_PIN) ;*
NOTE: I'm not using Modbs RS485, just Modbus TCP
How to fix it?
pylon
September 27, 2022, 8:41pm
2
The library was written for the MKR series of Arduinos. It was never adapted for the Zero and some other boards.
You can edit RS485.h and change the lines
#define RS485_DEFAULT_DE_PIN A6
#define RS485_DEFAULT_RE_PIN A5
so the pins match your actual values.
fleaplc
September 28, 2022, 7:27am
3
what is the right synthax for Arduino 0?
pylon
September 28, 2022, 2:23pm
4
As you failed to provide a wiring diagram of your setup, we cannot tell you that.
system
Closed
March 27, 2023, 2:24pm
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.