Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiPin (timing?)-Problem when using setResolution() #208

Open
stif opened this issue Nov 8, 2021 · 0 comments
Open

MultiPin (timing?)-Problem when using setResolution() #208

stif opened this issue Nov 8, 2021 · 0 comments

Comments

@stif
Copy link

stif commented Nov 8, 2021

I am testing with the TwoPin_DS18B20.ino Example and both Sensors are working as expected.

But when i add following code in setup() function after sensor.begin():

if(sensor_inhouse.getAddress(inAdd, 0)) {
    sensor_inhouse.setResolution(inAdd, 12);
  }
  if(sensor_outhouse.getAddress(outAddr, 0)) {
    sensor_outhouse.setResolution(outAddr, 12);
  }

the reading of the first sensor who executes the requestTemperatures function is stuck (i get a response, but always the same value regardless of real temperature). the sensor which executes the requestTemperatures function the line beneath the first one is ok. if i swap these 2 lines it is still the first sensor in code appearance which get stuck. eg.:

sensorX.requestTemperatures(); <- this sensor is stuck
sensorY.requestTemperatures(); <- this one is ok

Also it does not matter if the resolution is set to 9, 10, 11 or 12. If setResolution is executed the first sensor who do a requestTemperatures is stuck. If setResolution is not executed, both sensors work as they should.

Workaround:
Just set the setResolution and upload the sketch. Then comment out the setResolution function and upload again. The Sensor will remember the resolution from previous upload and when the setResolution function is not executed in the actual Sketch both Sensors work as expected with wanted resolution..

PS: I am working with latest PlatformIO and ESP32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant