Skip to content

Commit 8c9103f

Browse files
authored
fix formatting error
1 parent 196532e commit 8c9103f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

view/electricity-monitoring/ac-power-theory/arduino-maths.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Real power is the average of instantaneous power. The calculation is relatively
1818

1919
First we calculate the instantaneous power by multiplying the instantaneous voltage measurement by the instantaneous current measurement. We sum the instantaneous power measurement over a given number of samples and divide by that number of samples:
2020

21-
<pre><span style="color: #CC6600;">for</span> (n=0; n<number_of_samples; n++)
21+
<pre><span style="color: #CC6600;">for</span> (n=0; n&lt;number_of_samples; n++)
2222
{
2323
  <span style="color: #7E7E7E;">// inst_voltage and inst_current calculation from raw ADC input goes here</span>
2424

@@ -35,7 +35,7 @@ real_power = sum_inst_power / number_of_samples;
3535

3636
The root-mean-square is calculated in the way the name suggests. First we square the quantity, then we calculate the mean and finally, the square-root of the mean of the squares, this is how its done:
3737

38-
<pre><span style="color: #CC6600;">for</span> (n=0; n<number_of_samples; n++)
38+
<pre><span style="color: #CC6600;">for</span> (n=0; n&lt;number_of_samples; n++)
3939
{
4040
  <span style="color: #7E7E7E;">// inst_voltage calculation from raw ADC input goes here.</span>
4141

@@ -52,7 +52,7 @@ root_mean_square_voltage = <span style="color: #CC6600;">sqrt</span>(mean_squa
5252

5353
Same as the RMS voltage calculation:
5454

55-
<pre><span style="color: #CC6600;">for</span> (n=0; n<number_of_samples; n++)
55+
<pre><span style="color: #CC6600;">for</span> (n=0; n&lt;number_of_samples; n++)
5656
{
5757
  <span style="color: #7E7E7E;">// inst_current calculation from raw ADC input goes here.</span>
5858

0 commit comments

Comments
 (0)