'dirPin' cannot be used as a function

You can't have a function with the same name as one of your pins.