mandulaj / PZEM-004T-v30

Arduino library for the Updated PZEM-004T v3.0 Power and Energy meter
MIT License
256 stars 108 forks source link

Need example code (Arduino) to 'set' and 'read' getPowerAlarm(); and setPowerAlarm(uint16_t watts); #42

Open lost-bro opened 3 years ago

lost-bro commented 3 years ago

Hello I can't seem to get the 'getPowerAlarm()' function to output a usable response. Does the returned value (boolean) in this case represent that the power alarm is 'triggered'? Or does it only signify that a value has been added to the 'setPowerAlarm' register? If you could point me in the direction of an example of working code for the 'get and set' Power alarm functions, it would be very much appreciated.

**forgot to mention that I am using a Chinese Arduino nano clone, all other functions work perfectly for my application so the only issue seems to be the configuration of the power alarm.

Thanks in advance. mjd

mandulaj commented 3 years ago

@lost-bro Thanks for the report, I will have a look into it