Added INA233
Some checks failed
Test compiling project / test (push) Failing after 1m39s

This commit is contained in:
2024-07-28 17:45:49 +02:00
parent ce08e4c211
commit 1d19e23df6
5 changed files with 134 additions and 11 deletions

26
lib/INA233/INA233.h Normal file
View File

@@ -0,0 +1,26 @@
#pragma once
#include "Arduino.h"
#include "Wire.h"
#define REGISTER_READ_VIN 0x88
#define REGISTER_READ_VSHUNT 0xd1
class INA233{
public:
INA233(uint8_t addr, TwoWire *wire = &Wire);
bool begin(const uint8_t sda, const uint8_t scl);
float getBusVoltage(void);
float getShuntVoltage_mV(void);
float getShuntVoltage(void);
bool isConnected(void);
private:
float _current_LSB;
float _shunt;
float _maxCurrent;
uint8_t _address;
TwoWire * _wire;
};