A simple serial test program for the MAX17048 library.

Dependencies:   MAX17048 mbed

main.cpp

Committer:
neilt6
Date:
2013-08-14
Revision:
0:54ca3b1d1f75
Child:
1:d098c4448f6d

File content as of revision 0:54ca3b1d1f75:

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

MAX17048 gauge(p28, p27);

int main() {
    while (1) {
        //Read the cell voltage
        float vcell = gauge.vcell();

        //Print the cell voltage
        printf("Vcell = %f\n", vcell);

        //Sleep for 0.5 seconds
        wait(0.5);
    }
}