You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great work, I am using Your Sketch on a Mega for my Home Automation and it works fine, Thank You for that.
But now I wanted to port it to a DUE, because the Mega is running out of Speed.
I have problems compiling Your Sketch on my DUE causing a HardwareSerial error.
Working on a MAC Version 10.11.2, Arduino 1.65 gives this error:
Arduino:` 1.6.5 (Mac OS X), Platine: "Arduino Due (Programming Port)"
ModbusSensor.cpp: In member function 'void modbusMaster::begin(uint16_t, uint8_t)':
ModbusSensor.cpp:205: error: no matching function for call to 'HardwareSerial::begin(uint16_t&, uint8_t&)'
(__hwSerial).begin(baudrate, byteFormat);
^
ModbusSensor.cpp:205:42: note: candidate is:
In file included from /Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/Arduino.h:195:0,
from ModbusSensor.h:16,
from ModbusSensor.cpp:25:
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/HardwareSerial.h:29:18: note: virtual void HardwareSerial::begin(long unsigned int)
virtual void begin(unsigned long);
^
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/HardwareSerial.h:29:18: note: candidate expects 1 argument, 2 provided
ModbusSensor.cpp: In member function 'boolean modbusMaster::available()':
ModbusSensor.cpp:251: error: 'class HardwareSerial' has no member named 'availableForWrite'
if ((__hwSerial).availableForWrite() == SERIAL_TX_BUFFER_SIZE - 1) { //TX buffer empty
^
ModbusSensor.cpp:251: error: 'SERIAL_TX_BUFFER_SIZE' was not declared in this scope
if ((*_hwSerial).availableForWrite() == SERIAL_TX_BUFFER_SIZE - 1) { //TX buffer empty
^
no matching function for call to 'HardwareSerial::begin(uint16_t&, uint8_t&)'
I changed "HardwareSerial" to "USARTClass" in Your ModbusSensor.cpp( one time ) and in ModbusSensor.h ( two times ).
But now I get this error:
Arduino: 1.6.5 (Mac OS X), Platine: "Arduino Due (Programming Port)"
ModbusSensor.cpp: In member function 'void modbusMaster::begin(uint16_t, uint8_t)':
ModbusSensor.cpp:205: error: call of overloaded 'begin(uint16_t&, uint8_t&)' is ambiguous
(__hwSerial).begin(baudrate, byteFormat);
^
ModbusSensor.cpp:205:42: note: candidates are:
In file included from /Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/variants/arduino_due_x/variant.h:39:0,
from /Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/Arduino.h:201,
from ModbusSensor.h:16,
from ModbusSensor.cpp:25:
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/USARTClass.h:111:10: note: void USARTClass::begin(uint32_t, USARTClass::USARTModes)
void begin(const uint32_t dwBaudRate, const USARTModes config);
^
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/USARTClass.h:111:10: note: no known conversion for argument 2 from 'uint8_t {aka unsigned char}' to 'USARTClass::USARTModes'
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/USARTClass.h:112:10: note: void USARTClass::begin(uint32_t, UARTClass::UARTModes)
void begin(const uint32_t dwBaudRate, const UARTModes config);
^
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/USARTClass.h:112:10: note: no known conversion for argument 2 from 'uint8_t {aka unsigned char}' to 'UARTClass::UARTModes'
ModbusSensor.cpp: In member function 'boolean modbusMaster::available()':
ModbusSensor.cpp:251: error: 'SERIAL_TX_BUFFER_SIZE' was not declared in this scope
if ((__hwSerial).availableForWrite() == SERIAL_TX_BUFFER_SIZE - 1) { //TX buffer empty
^
call of overloaded 'begin(uint16_t&, uint8_t&)' is ambiguous
Will You please help me porting Your great work to an Arduino DUE?
The text was updated successfully, but these errors were encountered:
I'm sorry, at this moment I can't spend time in this project. Also I haven't studied Arduino DUE and different libraries to adapt.
This problem is developed in #11
you can use a different alternative to check when the Txbuffer is empty. Maybe UARTclass has a bool function to check it.
Great work, I am using Your Sketch on a Mega for my Home Automation and it works fine, Thank You for that.
But now I wanted to port it to a DUE, because the Mega is running out of Speed.
I have problems compiling Your Sketch on my DUE causing a HardwareSerial error.
Working on a MAC Version 10.11.2, Arduino 1.65 gives this error:
Arduino:` 1.6.5 (Mac OS X), Platine: "Arduino Due (Programming Port)"
ModbusSensor.cpp: In member function 'void modbusMaster::begin(uint16_t, uint8_t)':
ModbusSensor.cpp:205: error: no matching function for call to 'HardwareSerial::begin(uint16_t&, uint8_t&)'
(__hwSerial).begin(baudrate, byteFormat);
^
ModbusSensor.cpp:205:42: note: candidate is:
In file included from /Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/Arduino.h:195:0,
from ModbusSensor.h:16,
from ModbusSensor.cpp:25:
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/HardwareSerial.h:29:18: note: virtual void HardwareSerial::begin(long unsigned int)
virtual void begin(unsigned long);
^
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/HardwareSerial.h:29:18: note: candidate expects 1 argument, 2 provided
ModbusSensor.cpp: In member function 'boolean modbusMaster::available()':
ModbusSensor.cpp:251: error: 'class HardwareSerial' has no member named 'availableForWrite'
if ((__hwSerial).availableForWrite() == SERIAL_TX_BUFFER_SIZE - 1) { //TX buffer empty
^
ModbusSensor.cpp:251: error: 'SERIAL_TX_BUFFER_SIZE' was not declared in this scope
if ((*_hwSerial).availableForWrite() == SERIAL_TX_BUFFER_SIZE - 1) { //TX buffer empty
^
no matching function for call to 'HardwareSerial::begin(uint16_t&, uint8_t&)'
Then I found this Thread in the Arduino Forum:
http://forum.arduino.cc/index.php?topic=142753.0
I changed "HardwareSerial" to "USARTClass" in Your ModbusSensor.cpp( one time ) and in ModbusSensor.h ( two times ).
But now I get this error:
ModbusSensor.cpp: In member function 'void modbusMaster::begin(uint16_t, uint8_t)':
ModbusSensor.cpp:205: error: call of overloaded 'begin(uint16_t&, uint8_t&)' is ambiguous
(__hwSerial).begin(baudrate, byteFormat);
^
ModbusSensor.cpp:205:42: note: candidates are:
In file included from /Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/variants/arduino_due_x/variant.h:39:0,
from /Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/Arduino.h:201,
from ModbusSensor.h:16,
from ModbusSensor.cpp:25:
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/USARTClass.h:111:10: note: void USARTClass::begin(uint32_t, USARTClass::USARTModes)
void begin(const uint32_t dwBaudRate, const USARTModes config);
^
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/USARTClass.h:111:10: note: no known conversion for argument 2 from 'uint8_t {aka unsigned char}' to 'USARTClass::USARTModes'
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/USARTClass.h:112:10: note: void USARTClass::begin(uint32_t, UARTClass::UARTModes)
void begin(const uint32_t dwBaudRate, const UARTModes config);
^
/Users/abe/Library/Arduino15/packages/arduino/hardware/sam/1.6.7/cores/arduino/USARTClass.h:112:10: note: no known conversion for argument 2 from 'uint8_t {aka unsigned char}' to 'UARTClass::UARTModes'
ModbusSensor.cpp: In member function 'boolean modbusMaster::available()':
ModbusSensor.cpp:251: error: 'SERIAL_TX_BUFFER_SIZE' was not declared in this scope
if ((__hwSerial).availableForWrite() == SERIAL_TX_BUFFER_SIZE - 1) { //TX buffer empty
^
call of overloaded 'begin(uint16_t&, uint8_t&)' is ambiguous
Will You please help me porting Your great work to an Arduino DUE?
The text was updated successfully, but these errors were encountered: