c++ stuff
I program in c and I cannot find any help with this problem in the C++ searches I have done.
I am accessing several DHT11 packages. I am using the dht11 lib which seems to be written in C++
I am trying to use a function to process the serial data received from each of the packages.
my problem is I am trying to use a pointer to each package's data.
proper includes
#include <dht11.h>
I declared the objects
dht11 DHT11one;
dht11 DHT11two;
//then within the loop I will call each one and send it to:
void loop
{
int chk1 = DHT11one.read(DHTPIN1);
int chk2 = DHT11two.read(DHTPIN2);
doTemp( &DHT11one);
doTemp( &DHT11two);
}
void doTemp(dht11 *DHT11chk)
{
float aTemp = *DHT11chk.temperature;
do other stuff ... (store the temperature in a array, calc the average and send it to a display)
}
I guess I do not understand C++ but this does not work. it tells me that DHT11chk is not declared within this scope
any and all help is appreciated!
Moderator edit:
</mark> <mark>[code]</mark> <mark>
</mark> <mark>[/code]</mark> <mark>
tags added.
Author edit: clarify some information and correct a typo.