Compatibility with a library


Hi Particle community,

Would it be possible to adapt the following library to work with particle?

At the moment it works only with arduino, since when trying to compile it with particle, the following error appears:

../wiring/inc/spark_wiring_usbserial.h:105:33: ambiguating new declaration of 'HardwareSerial _fetch_usbserial()'

pzem-004T is a module that measures energy variables, I am aware that it has isolation problems to improve, but I find it interesting to make it work with a particle device but and quite new in this.



To get rid of that error you just need to comment line 32 (//extern HardwareSerial Serial;) in PZEM004Tv30.cpp.

What platform are you intending to use this library with?
The PZEMHardSerial example uses Serial3 which is not available on most Particle devices but you can use Serial1 (tied to RX/TX pins on all Particle boards) in place of it.