#include
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
class pH
{
int Stable;
unsigned long previousMillis;
long Gap;
//SoftwareSerial pHrs(100,100);
//SoftwareSerial portOne(100, 100);
//SoftwareSerial pHrs = new SoftwareSerial(90,90);
SoftwareSerial SerialPort;
// Constructor - creates a pH
// and initializes the member variables and state
public: pH(uint8_t tx, uint8_t rx, long pHgap)
{
Gap = pHgap;
//SerialPort(rx, tx);
}
};
< /code>
Но получите это: < /p>
/home/san/Projekty/pHmetr/rs8/rs8.ino: In constructor 'pH::pH(uint8_t, uint8_t, long int)':
rs8:26: error: no matching function for call to 'SoftwareSerial::SoftwareSerial()'
{
^
/home/san/Projekty/pHmetr/rs8/rs8.ino:26:3: note: candidates are:
In file included from /home/san/Projekty/pHmetr/rs8/rs8.ino:1:0:
/home/san/.local/share/umake/ide/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.h:89:3: note: SoftwareSerial::SoftwareSerial(uint8_t, uint8_t, bool)
SoftwareSerial(uint8_t receivePin, uint8_t transmitPin, bool inverse_logic = false);
^
/home/san/.local/share/umake/ide/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.h:89:3: note: candidate expects 3 arguments, 0 provided
/home/san/.local/share/umake/ide/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.h:47:7: note: constexpr SoftwareSerial::SoftwareSerial(const SoftwareSerial&)
class SoftwareSerial : public Stream
^
/home/san/.local/share/umake/ide/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.h:47:7: note: candidate expects 1 argument, 0 provided
exit status 1
no matching function for call to 'SoftwareSerial::SoftwareSerial()'
Я пытался найти решение самостоятельно, но почему -то я заблудился ...
С уважением!
Я пытаюсь создать какой -то класс, прошло очень много времени с тех пор, как я делал ООП, и в основном я все забыл.[code]#include
void setup() { // put your setup code here, to run once:
}
void loop() { // put your main code here, to run repeatedly:
}
class pH { int Stable; unsigned long previousMillis; long Gap; //SoftwareSerial pHrs(100,100); //SoftwareSerial portOne(100, 100); //SoftwareSerial pHrs = new SoftwareSerial(90,90); SoftwareSerial SerialPort;
// Constructor - creates a pH // and initializes the member variables and state public: pH(uint8_t tx, uint8_t rx, long pHgap) { Gap = pHgap; //SerialPort(rx, tx); }
}; < /code> Но получите это: < /p> /home/san/Projekty/pHmetr/rs8/rs8.ino: In constructor 'pH::pH(uint8_t, uint8_t, long int)': rs8:26: error: no matching function for call to 'SoftwareSerial::SoftwareSerial()' { ^ /home/san/Projekty/pHmetr/rs8/rs8.ino:26:3: note: candidates are: In file included from /home/san/Projekty/pHmetr/rs8/rs8.ino:1:0: /home/san/.local/share/umake/ide/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.h:89:3: note: SoftwareSerial::SoftwareSerial(uint8_t, uint8_t, bool) SoftwareSerial(uint8_t receivePin, uint8_t transmitPin, bool inverse_logic = false);
^ /home/san/.local/share/umake/ide/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.h:89:3: note: candidate expects 3 arguments, 0 provided /home/san/.local/share/umake/ide/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.h:47:7: note: constexpr SoftwareSerial::SoftwareSerial(const SoftwareSerial&) class SoftwareSerial : public Stream
^ /home/san/.local/share/umake/ide/arduino/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.h:47:7: note: candidate expects 1 argument, 0 provided exit status 1 no matching function for call to 'SoftwareSerial::SoftwareSerial()' [/code] Я пытался найти решение самостоятельно, но почему -то я заблудился ... С уважением!