Added constructor to allow passing pins to control