Now that I included particle.h I have landed into new problem:
this is the header file:
namespace DustSensor {
class DustSensor_Reader
{
public:
// returns bool
bool pms7003_read();
};
}
and the dustSensor.cpp file contains:
#include "dustSensor.h"
#include "Particle.h"
....
const bool DEBUG = false;
uint16_t calcChecksum = 0;
namespace DustSensor {
bool pms7003_read() {
// Particle.publish("PMS7003", printbuf, 60, PRIVATE);
// send data only when you receive data:
Serial.println("-- Reading PMS7003");
Serial1.begin(9600);
bool packetReceived = false;
.
.
.
}
}
in my ino file I have added include <dustSensor.h>
then where later I need to access the function form dustSensor.cpp I call it like this:
bool dust = DustSensor::DustSensor_Reader::pms7003_read();
but this is throwing error:
cannot call member function 'bool DustSensor::DustSensor_Reader::pms7003_read()' without object
please help…