Hello,
I would like to use an instance of SoftwareSerial (declared in the setup) in several fonction of a class i made.
Thx for your help.
src files :
#ifndef GMS_H
#define GMS_H
#include <Arduino.h>
#include "SoftwareSerial.h"
class GSM{
private:
uint8_t TX;
uint8_t RX;
String _phoneNumber;
public:
GSM(uint8_t TX,uint8_t RX);
void setPhoneNumber(String phoneNumber);
String getPhoneNumber();
void sendSMS(String msg);
String updateSerial();
};
#endif
I woluld like the GSM constructor to create an instance of SoftwareSerial that is used in the others méthode.
I would also be ok if the SoftwareSerial would be a parameter of the constructor and i guess would use a reference to the SoftwareSerial object declared in the setup/loop.