Skip to content

Commit 6c9be97

Browse files
flopp999mfalkvidd
authored andcommitted
Word corrections (#1114)
* Word corrections * Removed an enter Thanks @flopp999 !
1 parent bb77661 commit 6c9be97

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

examples/EnergyMeterPulseSensor/EnergyMeterPulseSensor.ino

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
*******************************
2020
*
2121
* REVISION HISTORY
22-
* Version 1.0 - Henrik EKblad
22+
* Version 1.0 - Henrik Ekblad
2323
*
2424
* DESCRIPTION
25-
* This sketch provides an example how to implement a distance sensor using HC-SR04
26-
* Use this sensor to measure KWH and Watt of your house meeter
27-
* You need to set the correct pulsefactor of your meeter (blinks per KWH).
28-
* The sensor starts by fetching current KWH value from gateway.
29-
* Reports both KWH and Watt back to gateway.
25+
* This sketch provides an example how to implement a LM393 PCB
26+
* Use this sensor to measure kWh and Watt of your house meter
27+
* You need to set the correct pulsefactor of your meter (blinks per kWh).
28+
* The sensor starts by fetching current kWh value from gateway.
29+
* Reports both kWh and Watt back to gateway.
3030
*
3131
* Unfortunately millis() won't increment when the Arduino is in
3232
* sleepmode. So we cannot make this sensor sleep if we also want
33-
* to calculate/report watt-number.
33+
* to calculate/report watt value.
3434
* http://www.mysensors.org/build/pulse_power
3535
*/
3636

@@ -46,8 +46,8 @@
4646
#include <MySensors.h>
4747

4848
#define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your light sensor. (Only 2 and 3 generates interrupt!)
49-
#define PULSE_FACTOR 1000 // Number of blinks per KWH of your meeter
50-
#define SLEEP_MODE false // Watt-value can only be reported when sleep mode is false.
49+
#define PULSE_FACTOR 1000 // Number of blinks per of your meter
50+
#define SLEEP_MODE false // Watt value can only be reported when sleep mode is false.
5151
#define MAX_WATT 10000 // Max watt value to report. This filters outliers.
5252
#define CHILD_ID 1 // Id of the sensor child
5353

@@ -60,10 +60,10 @@ volatile uint32_t lastBlink = 0;
6060
volatile uint32_t watt = 0;
6161
uint32_t oldPulseCount = 0;
6262
uint32_t oldWatt = 0;
63-
double oldKwh;
63+
double oldkWh;
6464
uint32_t lastSend;
6565
MyMessage wattMsg(CHILD_ID,V_WATT);
66-
MyMessage kwhMsg(CHILD_ID,V_KWH);
66+
MyMessage kWhMsg(CHILD_ID,V_KWH);
6767
MyMessage pcMsg(CHILD_ID,V_VAR1);
6868

6969

@@ -107,19 +107,19 @@ void loop()
107107
oldWatt = watt;
108108
}
109109

110-
// Pulse cout has changed
110+
// Pulse count value has changed
111111
if (pulseCount != oldPulseCount) {
112112
send(pcMsg.set(pulseCount)); // Send pulse count value to gw
113-
double kwh = ((double)pulseCount/((double)PULSE_FACTOR));
113+
double kWh = ((double)pulseCount/((double)PULSE_FACTOR));
114114
oldPulseCount = pulseCount;
115-
if (kwh != oldKwh) {
116-
send(kwhMsg.set(kwh, 4)); // Send kwh value to gw
117-
oldKwh = kwh;
115+
if (kWh != oldkWh) {
116+
send(kWhMsg.set(kWh, 4)); // Send kWh value to gw
117+
oldkWh = kWh;
118118
}
119119
}
120120
lastSend = now;
121121
} else if (sendTime && !pcReceived) {
122-
// No count received. Try requesting it again
122+
// No pulse count value received. Try requesting it again
123123
request(CHILD_ID, V_VAR1);
124124
lastSend=now;
125125
}
@@ -133,7 +133,7 @@ void receive(const MyMessage &message)
133133
{
134134
if (message.type==V_VAR1) {
135135
pulseCount = oldPulseCount = message.getLong();
136-
Serial.print("Received last pulse count from gw:");
136+
Serial.print("Received last pulse count value from gw:");
137137
Serial.println(pulseCount);
138138
pcReceived = true;
139139
}

0 commit comments

Comments
 (0)