Files
waterlevel-software/lib/INA233/INA233.h
Tobias 1d19e23df6
Some checks failed
Test compiling project / test (push) Failing after 1m39s
Added INA233
2024-07-28 17:45:49 +02:00

27 lines
487 B
C++

#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;
};