Read a LinkIt One's Battery Voltage

Published

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

Share

    Recommendations

    • Casting Contest

      Casting Contest
    • Make it Move Contest

      Make it Move Contest
    • Woodworking Contest

      Woodworking Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    Comments