Work in progress:
-add output for debug
-correct syntax
-use external interrupts
-rename pin