Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sparkfun/sparkfun_max17043_particle_library
Firmware library for the MAX17043 LiPo fuel gauge IC - used on SparkFun's Photon Battery Shield.
https://github.com/sparkfun/sparkfun_max17043_particle_library
firmware-library particle-photon photon-battery-shield
Last synced: about 1 month ago
JSON representation
Firmware library for the MAX17043 LiPo fuel gauge IC - used on SparkFun's Photon Battery Shield.
- Host: GitHub
- URL: https://github.com/sparkfun/sparkfun_max17043_particle_library
- Owner: sparkfun
- License: mit
- Created: 2015-06-22T19:09:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T20:29:06.000Z (over 4 years ago)
- Last Synced: 2024-05-20T00:12:51.916Z (7 months ago)
- Topics: firmware-library, particle-photon, photon-battery-shield
- Language: C++
- Size: 278 KB
- Stars: 14
- Watchers: 44
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-particle - SparkFunMAX17043
README
## SparkFun MAX17043 Particle Library
Firmware library SparkFun's Photon Battery Shield and the MAX17043 Breakout.
About
-------------------This is a firmware library for [SparkFun's Photon Battery Shield](https://www.sparkfun.com/products/13626).
[![Photon Battery Shield](https://cdn.sparkfun.com//assets/parts/1/1/0/0/9/13626-01a.jpg)](https://www.sparkfun.com/products/13626).
The MAX17043 interfaces between a LiPo battery and a microcontroller. The MAX17043 can read a battery's voltage and, using a sophisticated battery-modelling algorithm, estimate the state of charge (SOC).
Repository Contents
-------------------* **/doc** - Additional documentation for the user. These files are ignored by the IDE.
* **/firmware** - Source files for the library (.cpp, .h).
* **/firmware/examples** - Example sketches for the library (.cpp). Run these from the Particle IDE.
* **spark.json** - General library properties for the Particel library manager.Example Usage
-------------------Include the MAX17043 library:
#include "SparkFunMAX17043.h" // Include the SparkFun MAX17043 library
Then use the `lipo` object to interact with it. Begin by initializing the IC:void setup()
{
// Set up the MAX17043 LiPo fuel gauge:
lipo.begin(); // Initialize the MAX17043 LiPo fuel gauge// Quick start restarts the MAX17043 in hopes of getting a more accurate
// guess for the SOC.
lipo.quickStart();// We can set an interrupt to alert when the battery SoC gets too low.
// We can alert at anywhere between 1% - 32%:
lipo.setThreshold(10); // Set alert threshold to 10%.
}Then you can read the voltage and state-of-charge (SOC) values like this:
// lipo.getVoltage() returns a voltage value (e.g. 3.93)
voltage = lipo.getVoltage();
// lipo.getSOC() returns the estimated state of charge (e.g. 79%)
soc = lipo.getSOC();
Check out the example files in the [examples directory](https://github.com/sparkfun/SparkFun_MAX17043_Particle_Library/tree/master/firmware/examples) for more guidance.Recommended Components
-------------------* [Particle Photon](https://www.sparkfun.com/products/13345)
* [SparkFun Photon Battery Shield](https://www.sparkfun.com/products/13626)License Information
-------------------This product is _**open source**_!
Please review the LICENSE.md file for license information.
If you have any questions or concerns on licensing, please contact [email protected].
Distributed as-is; no warranty is given.
- Your friends at SparkFun.