changed read_nth_unit to use analog val