in test phase power monitoring for turtlebot

Dependencies:   PowerMonlib2 mbed

Fork of TestPMLIB by Sippakorn Saeng-aroon

main.cpp

Committer:
worasuchad
Date:
2018-07-23
Revision:
1:79b4bdf4997b
Parent:
0:fbbd04cdb029

File content as of revision 1:79b4bdf4997b:

#include "mbed.h"
#include "PowerMon.h"

Serial pc(USBTX, USBRX);  // tx, rx

int main() 
{
    pc.baud(115200);
    powerMon pmR2(0);
    int i;
    while(1)
    {
        wait(0.125);
        pc.printf("iterate : %i\t\t", i++);
        pc.printf("V_Source = %f\t\t", pmR2.V_Source());
        //pc.printf("V_Sense = %f\n", pmR2.V_Sense());
        pc.printf("Current = %f\t\t", pmR2.Current());
        //pc.printf("Power_R = %d\n", pmR2.Power_Ratio());
        pc.printf("Power = %f\n\r", pmR2.Power());
    }   
}