MAX17048_HelloWorld chages with SDA SCL pins changes for STM32F401RE NUCLIO

Dependencies:   MAX17048 mbed

Fork of MAX17048_HelloWorld by Neil Thiessen

main.cpp

Committer:
Harshal93
Date:
2018-03-07
Revision:
10:0bb44b369624
Parent:
6:20e76649ba57

File content as of revision 10:0bb44b369624:

#include "mbed.h"
#include "MAX17048.h"

MAX17048 gauge(PB_9, PB_8);

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");
    }
}