Self-test routine for Embedded Systems Coursework 2 Hardware