Introduction: Read a LinkIt One's Battery Voltage

Picture of Read a LinkIt One's Battery Voltage

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

Step 1: Upload Code

Picture of 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

Picture of 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

Comments

DIY Hacks and How Tos (author)2015-10-18

Nice. It can monitor it's own battery. Great idea.

About This Instructable

164views

6favorites

License:

Bio: 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 ... More »
More by Funguypro:3D Print Your House!!!!!DIY Raspberry Pi Indoor Outdoor WebcamSee Through Buildings With a Drone
Add instructable to: