Fixed solution, Fixed pin assignements

Added pin mode initialization.
Events now work properly.
Minimized warnings.