Skip to content

Commit

Permalink
add INA228
Browse files Browse the repository at this point in the history
  • Loading branch information
qqqlab committed Jan 12, 2025
1 parent d1e18eb commit 8720bf4
Show file tree
Hide file tree
Showing 10 changed files with 1,538 additions and 21 deletions.
2 changes: 1 addition & 1 deletion examples/01.Quadcopter/madflight_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//#define MAG_I2C_ADR 0x77 // Set magnetometer I2C address, leave commented for default address. If unknown, use CLI 'i2c'

//--- BATTERY MONITOR
#define BAT_USE BAT_USE_NONE // Select one: BAT_USE_INA226, BAT_USE_ADC, BAT_USE_NONE
#define BAT_USE BAT_USE_NONE // Select one: BAT_USE_INA226, BAT_USE_INA228, BAT_USE_ADC, BAT_USE_NONE

//--- BLACKBOX LOGGER
#define BB_USE BB_USE_NONE // Select one: BB_USE_SD, BB_USE_SDMMC, BB_USE_NONE
Expand Down
2 changes: 1 addition & 1 deletion examples/02.QuadcopterAdvanced/madflight_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//#define MAG_I2C_ADR 0x77 // Set magnetometer I2C address, leave commented for default address. If unknown, use CLI 'i2c'

//--- BATTERY MONITOR
#define BAT_USE BAT_USE_NONE // Select one: BAT_USE_INA226, BAT_USE_ADC, BAT_USE_NONE
#define BAT_USE BAT_USE_NONE // Select one: BAT_USE_INA226, BAT_USE_INA228, BAT_USE_ADC, BAT_USE_NONE

//--- BLACKBOX LOGGER
#define BB_USE BB_USE_NONE // Select one: BB_USE_SD, BB_USE_SDMMC, BB_USE_NONE
Expand Down
2 changes: 1 addition & 1 deletion examples/03.Plane/madflight_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//#define MAG_I2C_ADR 0x77 // Set magnetometer I2C address, leave commented for default address. If unknown, use CLI 'i2c'

//--- BATTERY MONITOR
#define BAT_USE BAT_USE_NONE // Select one: BAT_USE_INA226, BAT_USE_ADC, BAT_USE_NONE
#define BAT_USE BAT_USE_NONE // Select one: BAT_USE_INA226, BAT_USE_INA228, BAT_USE_ADC, BAT_USE_NONE

//--- BLACKBOX LOGGER
#define BB_USE BB_USE_NONE // Select one: BB_USE_SD, BB_USE_SDMMC, BB_USE_NONE
Expand Down
5 changes: 0 additions & 5 deletions src/madflight.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ SOFTWARE.
#define HW_PIN_OUT_LIST {}
#endif

//defaults for RCIN
#ifndef RCIN_NUM_CHANNELS
#define RCIN_NUM_CHANNELS 0
#endif

//defaults for madflight_setup();
#ifndef IMU_SAMPLE_RATE
#define IMU_SAMPLE_RATE 1000
Expand Down
58 changes: 58 additions & 0 deletions src/madflight/bat/INA228/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# changes for madflight

- replace TwoWire with HW_WIRETYPE (and move INA228.cpp into INA228.h to make it a "template")
- add calibrate()
- add isConversionReady()
- move i2c init from constructor to begin()


# Change Log INA228

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.1.4] - 2024-10-28
- add and rename wrappers for core functions
- update all examples
- update readme.md

## [0.1.3] - 2024-10-22
- fix #10, remove limit for the Amperes, kudos to geoFrancis
- fix handling negative values for **getShuntVoltage()**
- fix handling negative values for **getCurrent()**
- update readme.md
- add **INA228_demo_two_devices.ino**
- minor edits.

## [0.1.2] - 2024-09-29
- merge fix for temperature - kudos to xkachya!
- fix for getShuntVoltage() - kudos to markliquid1 (PR #8)
- refactored many functions.
- add INA228_CFG_REGISTER defines (register 0).
- add INA228_ADC_REGISTER defines (register 1).
- fix ADC functions.
- optimize **xxxDiagnoseAlertBit()** functions
- rename **clearDiagnoseAlertBit()**
- fix **getDieID()**
- add **INA228_performance.ino**
- change return type **getEnergy()** and **getCharge()** to double.
- update readme.md

## [0.1.1] - 2024-05-15
- add limit functions
- add threshold functions
- add constants for DiagnoseAlert register
- check them in unit test
- move register constants to .cpp
- make readRegister() and writeRegister() private
- update readme.md, keywords.txt
- minor edits

## [0.1.0] - 2024-05-10
- initial version



Loading

0 comments on commit 8720bf4

Please sign in to comment.