I have a seemingly simple problem that seems to be popular, but after searching several forums I still have not found the answer: How do you use a class inside of another class?
I have simplified my problem:
class A {
const int pin;
public:
A(int attachPin) : pin(attachPin) {
}
void setup() {
pinMode(pin, INPUT_PULLUP);
}
};
class B {
A myA;
public:
B(int a_attach) : myA(a_attach) {
}
void setup() {
myA.setup();
}
};
B test;
void setup() {
test.setup();
}
void loop() {
}