Read a LinkIt One's Battery Voltage

165

6

1

Posted

Introduction: Read a LinkIt One's Battery Voltage

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

  • Epilog Challenge 9

    Epilog Challenge 9
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
  • Gluten Free Challenge

    Gluten Free Challenge
user

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

Tips

Questions

Comments