Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
akkoyun committed Feb 16, 2024
1 parent 5703cd8 commit 2740ca8
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 359 deletions.
227 changes: 0 additions & 227 deletions examples/Full/Full.ino

This file was deleted.

57 changes: 9 additions & 48 deletions examples/Volt_Meter/Volt_Meter.ino
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
// Include Arduino Library
#ifndef __Arduino__
#ifndef Arduino_h
#include <Arduino.h>
#endif

// Library Console Definations
#ifndef __Console__
#include <Console.h>
#define CONSOLE_TEMPLATE_VOLTMETER
// Include MAX78630 Library
#ifndef __MAX78630__
#include <MAX78630.h>
#endif

// Define Libraries
#include <MAX78630.h>

// Declare Energy Analyzer
MAX78630 Energy_Analyzer;
Console Terminal(Serial);
MAX78630 Energy_Analyzer(__MAX78630_Serial__);

void setup() {

Expand All @@ -24,51 +19,17 @@ void setup() {
// Start MAX78630 Communication
Serial2.begin(38400);

// Start Terminal Console
Terminal.Begin();

// Draw Base Console
Terminal.MAX78630_Voltmeter();

// Start Power Analyzer
Energy_Analyzer.Begin(Serial2);
Energy_Analyzer.Begin();

}

void loop() {

// Print Measurements
Terminal.Text(7, 18, CYAN, String(Energy_Analyzer.Voltage(__Phase_R__, __RMS__),2));
Terminal.Text(7, 45, CYAN, String(Energy_Analyzer.Voltage(__Phase_S__, __RMS__),2));
Terminal.Text(7, 72, CYAN, String(Energy_Analyzer.Voltage(__Phase_T__, __RMS__),2));
Terminal.Text(13, 3, CYAN, String(Energy_Analyzer.Energy(__Phase_R__, __Active_Received__)));

// Terminal Command Routine
if (Serial.available() > 0) {

uint16_t Key = Serial.read();

// Terminal Beep
Terminal.Beep();

switch (Key) {
case '1':
Energy_Analyzer.Clear_Min_Value(1);
Energy_Analyzer.Clear_Max_Value(1);
break;
case '2':
Energy_Analyzer.Clear_Min_Value(2);
Energy_Analyzer.Clear_Max_Value(2);
break;
case '3':
Energy_Analyzer.Clear_Min_Value(3);
Energy_Analyzer.Clear_Max_Value(3);
break;

default:
break;
}
}
Serial.println("Phase R: " + String(Energy_Analyzer.Voltage(__Phase_R__, __RMS__),2) + " V");
Serial.println("Phase S: " + String(Energy_Analyzer.Voltage(__Phase_S__, __RMS__),2) + " V");
Serial.println("Phase T: " + String(Energy_Analyzer.Voltage(__Phase_T__, __RMS__),2) + " V");

// Loop Delay
delay(500);
Expand Down
9 changes: 1 addition & 8 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MAX78630",
"version": "4.9.1",
"version": "4.10.0",
"keywords": "MAX78630, Maxim, Silergy, Energy, Electric, Poly, Phase, Metering, Measure, Active, Reactive, Apparent, Voltage, Current, Power Factor, Cos Fi, Temperature, Fundamental, Harmonic, Defect, Alarm, Min, Max",
"description": "The EnergyBoard is an energy measurement module for poly phase power-monitoring systems. It is designed for real-time monitoring for a variety of typical three-phase configurations in industrial applications. The EnergyBoard provides up to six analog inputs for interfacing to voltage and current sensors. Scaled voltages from the sensors are fed to the single converter front-end using a high-resolution delta-sigma converter. Supported current sensors include current transformers (CTs), Rogowski coils, and resistive shunts.",
"authors":
Expand Down Expand Up @@ -29,13 +29,6 @@
"files": [
"Volt_Meter.ino"
]
},
{
"name": "Full_Meter",
"base": "examples/Full",
"files": [
"Full.ino"
]
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=MAX78630
version=4.9.1
version=4.10.0
author=Gunce Akkoyun <[email protected]>
maintainer=Gunce Akkoyun <[email protected]>
sentence=Enables reading polyphase energy-monitor parameters of LVX EnergyBoard.
Expand Down
5 changes: 5 additions & 0 deletions src/Config.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// UART Configuration
#ifndef __MAX78630_Serial__
#define __MAX78630_Serial__ Serial2
#endif

// Device Defaults
#define __MAX78630_Firmware__ (uint32_t)0x0004D912

Expand Down
4 changes: 4 additions & 0 deletions src/Definitions.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Function Definitions
#define __MAX78630_GET__ (bool)true
#define __MAX78630_SET__ (bool)false

// Phase Type
#define __Phase_R__ (uint8_t)1
#define __Phase_S__ (uint8_t)2
Expand Down
Loading

0 comments on commit 2740ca8

Please sign in to comment.