MAX17048_HelloWorld chages with SDA SCL pins changes for STM32F401RE NUCLIO
Fork of MAX17048_HelloWorld by
main.cpp
- Committer:
- neilt6
- Date:
- 2013-11-12
- Revision:
- 6:20e76649ba57
- Parent:
- 3:2152dd143ba3
- Child:
- 10:0bb44b369624
File content as of revision 6:20e76649ba57:
#include "mbed.h" #include "MAX17048.h" MAX17048 gauge(p28, p27); int main() { //Try to open the MAX17048 if (gauge.open()) { printf("Device detected!\n"); //Load the default compensation value gauge.compensation(MAX17048::RCOMP0); while (1) { //Print the current state of charge printf("SOC = %f%%\n", (float)gauge); //Sleep for 0.5 seconds wait(0.5); } } else { error("Device not detected!\n"); } }