loading

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

<p>Nice. It can monitor it's own battery. Great idea.</p>

About This Instructable

159views

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:See Through Buildings With a Drone Dog Water Alarm (V2) Custom PCB's With a Laser Cutter 
Add instructable to: