Cleanup includes and unnecessary prints
This commit is contained in:
parent
3e2f7e4043
commit
00deb173a8
4 changed files with 28 additions and 7 deletions
|
|
@ -16,7 +16,7 @@
|
|||
#ifndef WipperSnapper_I2C_Driver_H
|
||||
#define WipperSnapper_I2C_Driver_H
|
||||
|
||||
#include "../../../wippersnapper/i2c/v1/i2c.pb.h"
|
||||
#include "wippersnapper/i2c/v1/i2c.pb.h"
|
||||
#include <Adafruit_Sensor.h>
|
||||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
|
|
|
|||
|
|
@ -4,10 +4,18 @@
|
|||
* Device driver implementation for the INA237 DC Current and Voltage Monitor
|
||||
* (Avoids import conflict with INA260 typedef enum _mode etc)
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
* Copyright (c) Tyeth Gundry 2025 for Adafruit Industries.
|
||||
*
|
||||
* MIT license, all text here must be included in any redistribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "WipperSnapper_I2C_Driver_INA237.h"
|
||||
#include "../../../Wippersnapper.h"
|
||||
#include "Wippersnapper.h"
|
||||
#include <Adafruit_INA237.h>
|
||||
|
||||
/*******************************************************************************/
|
||||
|
|
@ -44,7 +52,6 @@ WipperSnapper_I2C_Driver_INA237::~WipperSnapper_I2C_Driver_INA237() {
|
|||
bool WipperSnapper_I2C_Driver_INA237::begin() {
|
||||
_ina237 = new Adafruit_INA237();
|
||||
if (!_ina237->begin(_sensorAddress, _i2c)) {
|
||||
WS_DEBUG_PRINTLN("INA237 failed to initialise!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,18 @@
|
|||
* Device driver implementation for the INA238 High-precision DC Current and
|
||||
* Voltage Monitor (Avoids import conflict with INA260 typedef enum _mode etc)
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
* Copyright (c) Tyeth Gundry 2025 for Adafruit Industries.
|
||||
*
|
||||
* MIT license, all text here must be included in any redistribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "WipperSnapper_I2C_Driver_INA238.h"
|
||||
#include "../../../Wippersnapper.h"
|
||||
#include "Wippersnapper.h"
|
||||
#include <Adafruit_INA238.h>
|
||||
|
||||
/*******************************************************************************/
|
||||
|
|
@ -44,7 +52,6 @@ WipperSnapper_I2C_Driver_INA238::~WipperSnapper_I2C_Driver_INA238() {
|
|||
bool WipperSnapper_I2C_Driver_INA238::begin() {
|
||||
_ina238 = new Adafruit_INA238();
|
||||
if (!_ina238->begin(_sensorAddress, _i2c)) {
|
||||
WS_DEBUG_PRINTLN("INA238 failed to initialise!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,18 @@
|
|||
*
|
||||
* Device driver implementation for the INA260 DC Current and Voltage Monitor
|
||||
*
|
||||
* Adafruit invests time and resources providing this open source code,
|
||||
* please support Adafruit and open-source hardware by purchasing
|
||||
* products from Adafruit!
|
||||
*
|
||||
* Copyright (c) Tyeth Gundry 2025 for Adafruit Industries.
|
||||
*
|
||||
* MIT license, all text here must be included in any redistribution.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "WipperSnapper_I2C_Driver_INA260.h"
|
||||
#include "../../../Wippersnapper.h"
|
||||
#include "Wippersnapper.h"
|
||||
#include <Adafruit_INA260.h>
|
||||
|
||||
/*******************************************************************************/
|
||||
|
|
@ -43,7 +51,6 @@ WipperSnapper_I2C_Driver_INA260::~WipperSnapper_I2C_Driver_INA260() {
|
|||
bool WipperSnapper_I2C_Driver_INA260::begin() {
|
||||
_ina260 = new Adafruit_INA260();
|
||||
if (!_ina260->begin(_sensorAddress, _i2c)) {
|
||||
WS_DEBUG_PRINTLN("INA260 failed to initialise!");
|
||||
return false;
|
||||
}
|
||||
// TODO: use setCalibration()
|
||||
|
|
|
|||
Loading…
Reference in a new issue