Add Pin Change interrupt and fix switch mode part.