reverting to the state of e76ada5a11, because something went wrong with the following commit
Reed sensor error fixed. It now works.