Undefined reference to `_ZN3SDMC1ER14HardwareSerialliib'
spinne1000 opened this issue · comments
Hello,
I'm triing to get a Wemos D1 mini with a RS485 to TTL adapter and a SDM72D-M running.
The adapter is connected via hardware serial to the Wemos. The Wemos sends debug-Messages over Software serial to another Wemos, which is working fine.
My code is:
#define USE_HARDWARESERIAL
#include <SDM.h>
#include <SoftwareSerial.h>
SoftwareSerial SoftSerial(D6, D5); // RX, TX
SDM sdm(Serial, SDM_UART_BAUD, NOT_A_PIN, SERIAL_8N1, false);
void setup() {
sdm.begin();
SoftSerial.begin(9600); //initialize serial
SoftSerial.println("Starting");
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
float voltage = sdm.readVal(SDM_PHASE_1_VOLTAGE);
SoftSerial.print("voltage: " );SoftSerial.println(voltage);
delay(500);
digitalWrite(LED_BUILTIN,LOW);
delay(500);
}
At compiletime, I got:
....ino:25: undefined reference to `_ZN3SDMC1ER14HardwareSerialliib'
It is the line: float voltage = sdm.readVal(SDM_PHASE_1_VOLTAGE);
In SDM_Config_User.h I have also #define USE_HARDWARESERIAL and SDM_RX_PIN to 3, and SDM_TX_PIN to 1
Any suggestions who I can get this working?
Thanks