Fixed pinmode and removed old writeData function from constructor