Display value on LCD

// display battery value on lcd
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.