Hallo,
ich bekomme folgenden Fehler in PlatformIO:
1 | D:\projects\SOLIS_4Gmini_arduino\src\4G_mini.cpp: In member function 'void SOLIS_4G_MINI::begin()':
|
2 | D:\projects\SOLIS_4Gmini_arduino\src\4G_mini.cpp:21:36: error: no matching function for call to 'ModbusMaster::begin(int&, Stream**)'
|
3 | _inverter.begin(_slaveID, &_serial);
|
4G_mini.h
1 | #ifndef _4G_MINI_H
|
2 | #define _4G_MINI_H
|
3 |
|
4 | #include <Arduino.h>
|
5 | #include <ModbusMaster.h>
|
6 | #include "registers.h"
|
7 |
|
8 | class SOLIS_4G_MINI {
|
9 | public:
|
10 | SOLIS_4G_MINI(Stream& serial,uint8_t dere_pin, uint8_t slave_id);
|
11 | void begin();
|
12 |
|
13 | private:
|
14 | Stream* _serial;
|
15 | int _dere_pin;
|
16 | int _slaveID;
|
17 |
|
18 | };
|
19 |
|
20 | #endif
|
4G_mini.cpp
1 | #include "4G_mini.h"
|
2 |
|
3 | ModbusMaster _inverter; //object node for class ModbusMaster
|
4 |
|
5 |
|
6 | SOLIS_4G_MINI::SOLIS_4G_MINI(Stream& serial,uint8_t dere_pin,uint8_t slave_id) {
|
7 | this->_serial = &serial;
|
8 | this->_dere_pin = dere_pin;
|
9 | this->_slaveID = _slaveID;
|
10 |
|
11 | }
|
12 |
|
13 | void preTransmission()
|
14 | {
|
15 | }
|
16 | void postTransmission()
|
17 | {
|
18 | }
|
19 |
|
20 | void SOLIS_4G_MINI::begin() {
|
21 | _inverter.begin(_slaveID, &_serial);
|
22 | _inverter.preTransmission(preTransmission); //Callback for configuring RS-485 Transreceiver correctly
|
23 | _inverter.postTransmission(postTransmission);
|
24 | }
|
Platformio.ini
1 | [env:uno]
|
2 | platform = atmelavr
|
3 | board = uno
|
4 | framework = arduino
|
5 |
|
6 | lib_deps =
|
7 | https://github.com/4-20ma/ModbusMaster.git
|
8 |
|
9 | lib_extra_dirs =
|
10 | D:\git\lib\SOLIS_4Gmini_arduino
|
Wie kann man das Problem am einfachsten beheben?
Vielen Dank im Vorraus.
TR.0LL