saving measurement after reading pin value