m3pi Battery dislay

  1. include "mbed.h"
  2. include "m3pi.h"

m3pi m3pi; float bat; char buffer [4];

int main() {

m3pi.locate(0,1); while(1) { bat=m3pi.battery(); bat=bat*1000; sprintf (buffer, "%f", bat); m3pi.cls(); m3pi.printf(buffer); wait(0.5); } }


Please log in to post comments.