fixed polarity issue on gpio outputs and Toggle() function