Code works, hardware dosn't