Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added wiring diagrams, datasheet and comments on code #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added wiring diagrams, datasheet and comments on code
  • Loading branch information
gayan committed May 25, 2017
commit 5d39a972395d6405ac0dd86805f8d2fbb30f036b
9 changes: 6 additions & 3 deletions examples/PZEMDisplay/PZEMDisplay.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include <SoftwareSerial.h> // Arduino IDE <1.6.6
#include <PZEM004T.h>


//https://www.arduino.cc/en/Tutorial/SoftwareSerialExample
//* RX is digital pin 10 (connect to TX of other device)
//* TX is digital pin 11 (connect to RX of other device)
PZEM004T pzem(10,11); // RX,TX
IPAddress ip(192,168,1,1);

Expand All @@ -11,8 +15,7 @@ void setup() {

void loop() {
float v = pzem.voltage(ip);
if (v < 0.0) v = 0.0;
Serial.print(v);Serial.print("V; ");
if (v < 0.0) {Serial.print(v);Serial.print("V; "); }

float i = pzem.current(ip);
if(i >= 0.0){ Serial.print(i);Serial.print("A; "); }
Expand All @@ -25,5 +28,5 @@ void loop() {

Serial.println();

// delay(1000);
//delay(1000);
}
Binary file added examples/SampleOutput.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/SampleWiringDiagram.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading