implemented current sensing range switching and autoranging functionality