SELKIELogger  1.0.0
PowerHatRead.c File Reference

Read values from a Raspberry Pi power hat (or compatible sensors) More...

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include "SELKIELoggerI2C.h"
Include dependency graph for PowerHatRead.c:

Go to the source code of this file.

Functions

int main (void)
 

Detailed Description

Read values from a Raspberry Pi power hat (or compatible sensors)

Definition in file PowerHatRead.c.

Function Documentation

◆ main()

int main ( void  )

Assumes that four INA219 chips are connected to /dev/i2c-1 using addresses 0x40 to 0x43, and polls for current values. Identifies some out of range conditions and will report an appropriate error message.

Returns
-1 on error, otherwise 0

Definition at line 44 of file PowerHatRead.c.