Setting pin modes in a custom library

In general, you can't use Arduino functions like pinMode() in constructors, because constructors are executed at the very start of a program, before other important "peripheral initialization" stuff has happened.

I can't tell for sure whether that's what has happened in your code, or not, due to the formatting.

The general "fix" is to have a separate "begin" member function that must be explicitly called from Arduino-level code (eg in setup())