Writing a library: use of the constructor

No. The general advice is not to initialise any hardware in the constructor because the object will be created before the hardware is ready

Rather, have an init() or similar function called from setup() so that you can be sure that the hardware is ready when it is executed

2 Likes