Arduino c++ classes, How to make instance variables of another class/library -
I am working with an Arduino UNO in my first attempt to use OO in the cables, I only have one The question with which I need help with I am using a class for filtration of DHT 22 sensor from filtransics, found here. Say that I have a class called sensor, where the DHT is a library for Fretrix sensor, and DHT DHT (5, DHT22) starts the sensor on pin 5 (which can be a digital pin):
#include "arduino.h" # Include & lt; DHT.h & gt; DHT DHT (1, DHT 22); Class sensor {public: sensor (int); }; Sensor :: sensor (int pin) (dht dht (pin, dht22);}
This is the only way to start a DHT that does not throw away the compilation of errors, even if This variability is restarting, but if I do DHT dht ()
it does not work as a private variable.
But my question is, if I If you create two objects, will they use the same object reference dht
or the 'code' for the first one? Is the code in the correct area of the code to work within the scope of the examples?
Please tell me that this is confusing, and I appreciate any help already, thank you :) < / P>
Comments
Post a Comment