#include <ArduinoJson.h>
class Employee {
public:
// Private attribute
int salary;
String ooph = "";
// Setter
void setSalary(int s) {
salary = s;
}
// Getter
int getSalary() {
return salary;
}
String test() {
JsonDocument doc;
doc["answefr"] = 42;
doc["answerx"] = 42;
serializeJson(doc, ooph);
//Serial.println(ooph);
//Serial.println("hjjj");
return ooph;
}
};
Employee myObj;
void setup() {
Serial.begin(115200);
// Create an object of Car
myObj.setSalary(50000);
Serial.println(myObj.getSalary());
Serial.println(myObj.test());
Serial.println(myObj.salary);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}