I just started using Arduino and I have been trying to move some of the libraries I have written to Arduino's software. I have started making classes for each one. When I am making a constructor for a class, I usually have a default constructor to set everything to 0 and others to set the private variables. From the example on how to make libraries, I was unsure if you could have more than one constructor in the class. Can you?
You can have multiple constructors, if their function signature (number/types of parameters) doesn’t match.
Example:
class Button
{
public:
Button(); // <-- Default constructor
Button(const uint8_t &pin); // <-- 2nd constructor with different parameters
};
Thanks for the information