Source Code Docs

struct power_monitor_str
#include <setup.h>

Struct used to store INA-219 sensor values.

Public Members

uint32_t count

Sampling count.

float actual_voltage

Sampled voltage (in V).

float min_voltage

Minimum sampled voltage (in V).

float max_voltage

Maximum sampled voltage (in V).

float avg_voltage

Average sampled voltage (in V).

float sum_voltage

Sum of all sampled voltage (in V).

float actual_current

Sampled current (in mA).

float min_current

Minimum sampled current (in mA).

float max_current

Maximum sampled current (in mA).

float avg_current

Average sampled current (in mA).

float sum_current

Sum of all sampled current (in mA).

file setup.h
#include <Wire.h>
#include <Adafruit_INA219.h>
#include <MCUFRIEND_kbv.h>
#include <Adafruit_GFX.h>
#include <TouchScreen.h>

Defines

BLACK

TFT black color.

BLUE

TFT blue color.

RED

TFT red color.

GREEN

TFT green color.

CYAN

TFT cyan color.

MAGENTA

TFT magenta color.

YELLOW

TFT yellow color.

WHITE

TFT white color.

MINPRESSURE

TFT minimal pressure.

MAXPRESSURE

TFT maximum pressure.

XP

Pinout of X+.

XM

Pinout of X-.

YP

Pinout of Y+.

YM

Pinout of Y-.

INA219_ADDR

INA-219 I2C address.

SAMPLE_INTERVAL

INA-219 sampling interval (in ms).

SHOW_INTERVAL

LCD showing interval (in ms).

Variables

Adafruit_INA219 ina219_sensor = Adafruit_INA219(INA219_ADDR)

INA219 object.

MCUFRIEND_kbv tft

LCD object.

power_monitor_str sensor_values

Sensor values struct.

uint16_t tft_id = 0

LCD identification.

uint64_t last_sample = 0

Last sample moment (in ms).

uint64_t last_show = 0

Last show moment (in ms).

file main.cpp
#include <Arduino.h>
#include “setup.h

Functions

void setup()

Configure all parameters before call loop function.

void loop()

Loop function executed cyclically.

dir include
dir src