Changed threaded callback to wait-for-edge interrupt detect. Ready for testing and debugging.