RPICTlib: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 19: | Line 19: | ||
==Definition and initialisation== | ==Definition and initialisation== | ||
===Definitions=== | |||
The library must called in the arduino sketch with the following include. | The library must called in the arduino sketch with the following include. | ||
#include "RPICTlib.h" | #include "RPICTlib.h" | ||
Line 32: | Line 33: | ||
ADC_REF is either 3300 or 4096 depending on the board type. | ADC_REF is either 3300 or 4096 depending on the board type. | ||
There are fours classes to | ===Classes=== | ||
There are fours classes to construct computation nodes. These are | |||
* SignalNode | * SignalNode | ||
* PowerNode | * PowerNode | ||
* SignalNode_mcp3208 | * SignalNode_mcp3208 | ||
* PowerNode_mcp3208 | * PowerNode_mcp3208 | ||
An example where CT1 is a simple rms compuation node: | |||
SignalNode CT1; | |||
You might take a look into the RPICTlib.h file for more detailed information on these classes. | |||
===Initialisation=== | |||
The ''begin'' function is used to initialised the computation node. Usually in the setup section of the arduino sketch. For example: | |||
CT1.begin(ct1, 83.33); | |||
ct1 being the I/O pin of ct1 and 83.33 the calibration value. |
Revision as of 18:47, 15 October 2020
Version History
- V1.1.0
- Frequency Support.
- ADC Reference can now be set. (Needed for RPICT7V1 Version 4).
- Various code optimisation.
- CurrentNode now called SignalNode (We figured out this can equally measure Voltage as well).
- V1.0.1
- Modified timing control. Now uses better sync checks.
- Added support for computing Irms alone with PowerNode class. Was missing on previous version.
- mcp3208 now reading a bit faster. Using full bit banging now.
- V1.0.0
- Initial version
Usage Examples
Definition and initialisation
Definitions
The library must called in the arduino sketch with the following include.
#include "RPICTlib.h"
Three compiler variable must also be defined.
uint8_t ADC_BITS = 10; uint16_t ADC_COUNTS (1 << ADC_BITS); uint16_t ADC_REF = 3300;
ADC_BITS is 10 for the RPICT board with attiny84 and 12 for the RPICT with mcp3208.
ADC_REF is either 3300 or 4096 depending on the board type.
Classes
There are fours classes to construct computation nodes. These are
- SignalNode
- PowerNode
- SignalNode_mcp3208
- PowerNode_mcp3208
An example where CT1 is a simple rms compuation node:
SignalNode CT1;
You might take a look into the RPICTlib.h file for more detailed information on these classes.
Initialisation
The begin function is used to initialised the computation node. Usually in the setup section of the arduino sketch. For example:
CT1.begin(ct1, 83.33);
ct1 being the I/O pin of ct1 and 83.33 the calibration value.