provisional code for original analog battery measurement