Read a LinkIt One's Battery Voltage

Introduction: Read a LinkIt One's Battery Voltage

About: I like to create new things! I'm very interested in IOT and just Internet Stuff. I am not responsible for any injury or deaths caused by my projects.

In this project we will read the LinkIt One's Battery Voltage

Step 1: Upload Code

If you don't know how to upload the linkit one's code click here

I've made a code to read the battery voltage as listed below:

------------------------------------------------------------->

#include<LBattery.h>

charbuff[256];


voidsetup(){

Serial.begin(9600);

}

voidloop(){

sprintf(buff,"My battery level is at = %d",LBattery.level(),"%");

Serial.print(buff);

if(LBattery.isCharging()==1){

Serial.println(" And i am charging!");

}

else{

Serial.println("|");

}

delay(10000);

}

Step 2: Plug in Your Battery and Read Serial Data

Once your code is uploaded then select the other com port of your linkit one (don't forget to change it back before uploading again!) and open your serial monitor. Wait and within 10 seconds you should see your first reading!

Step 3: Need Help?

Contact Me Here

Be the First to Share

    Recommendations

    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Super-Size Speed Challenge

      Super-Size Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020

    Discussions