File tree 3 files changed +10
-10
lines changed
3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 17
17
18
18
void setup () {
19
19
/* Initialize the serial port to host */
20
- Serial.begin (9600 );
20
+ Serial.begin (115200 );
21
21
/* Initialise the ATM90E26 + SPI port */
22
22
InitEnergyIC ();
23
23
}
@@ -26,19 +26,19 @@ void loop() {
26
26
/* Repeatedly fetch some values from the ATM90E26 */
27
27
Serial.print (" Sys Status:" );
28
28
Serial.println (GetSysStatus (),HEX);
29
- delay ( 10 );
29
+ yield ( );
30
30
Serial.print (" Meter Status:" );
31
31
Serial.println (GetMeterStatus (),HEX);
32
- delay ( 10 );
32
+ yield ( );
33
33
Serial.print (" Voltage:" );
34
34
Serial.println (GetLineVoltage ());
35
- delay ( 10 );
35
+ yield ( );
36
36
Serial.print (" Current:" );
37
37
Serial.println (GetLineCurrent ());
38
- delay ( 10 );
38
+ yield ( );
39
39
Serial.print (" Active power:" );
40
40
Serial.println (GetActivePower ());
41
- delay ( 10 );
41
+ yield ( );
42
42
Serial.print (" p.f.:" );
43
43
Serial.println (GetPowerFactor ());
44
44
delay (1000 );
Original file line number Diff line number Diff line change 70
70
71
71
// pins used for the connection with the sensor
72
72
// the other you need are controlled by the SPI library):
73
- const int energy_IRQ = 2 ;
73
+ // const int energy_IRQ = 2;
74
74
const int energy_CS = 10 ;
75
- const int energy_WO = 8 ;
75
+ // const int energy_WO = 8;
76
76
77
77
unsigned short CommEnergyIC (unsigned char RW ,unsigned char address , unsigned short val );
78
78
double GetLineVoltage ();
Original file line number Diff line number Diff line change @@ -124,9 +124,9 @@ unsigned short GetSysStatus(){
124
124
void InitEnergyIC (){
125
125
unsigned short systemstatus;
126
126
127
- pinMode (energy_IRQ,INPUT );
127
+ // pinMode(energy_IRQ,INPUT );
128
128
pinMode (energy_CS,OUTPUT );
129
- pinMode (energy_WO,INPUT );
129
+ // pinMode(energy_WO,INPUT );
130
130
131
131
/* Enable SPI */
132
132
SPI.begin ();
You can’t perform that action at this time.
0 commit comments