PDA

View Full Version : Manipulating ADC values....



dbachman
- 7th May 2016, 04:36
I don't know if that is the proper title but this is what I need to do...

I have two ADC values and they basically are never equal. What I want to be able to do is when the values are within a certain range say +/- 5 I want to set them equal... Is there a way to do this in PICBSIC?

Thanks, Don

richard
- 7th May 2016, 08:35
if abs (read1 - read2)< 5 then
equal=1
else
equal=0
endif

dbachman
- 10th May 2016, 04:59
Thanks Richard, Got it working......