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

When using setSamples() in DHT only humidity is sampled multiple times #176

Closed
user2684 opened this issue Jul 16, 2017 · 0 comments
Closed
Milestone

Comments

@user2684
Copy link
Contributor

This is because for any sensor which is creating multiple child ids, only the last one is returned so calling setSamples() will only apply to the last child id (humidity).
When generating multiple child IDs, each child has to be retrieved individually:

  int a = nodeManager.registerSensor(SENSOR_DHT22,6);
  nodeManager.setSleep(SLEEP,1,MINUTES);
  SensorDHT* t = (SensorDHT*)nodeManager.get(a-1);
  SensorDHT* h = (SensorDHT*)nodeManager.get(a);
  t->setSamples(5);
  h->setSamples(5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant