Power Indicator

This page shows how to use the powerIndicator widget to display system power status. 

The widget automatically responds to changes in power source, i.e. AC to DC power and vice versa, and it will update the battery graphic to indicate the current battery level (when on battery power). Additionally, an API interface is available so the information can be used within an applications.

The source code below shows how to use the widget in your application. The constructor takes three arguments:
  • id - the id of the img tag to be created by the powerIndicator widget 
  • container - the id of <div> element  which will contain the widget
  • updateInterval - how often the battery level will be updated (in secs)

You just instantiate the object and forget.


Source code
    ...
    
    <script type="text/javascript" src="PowerIndicator.js"></script>
     
    <script type="text/javascript">
    function onPageLoad()
    {
        powerIndicatorExample = new powerIndicator( "pwrSrc", "pwrSrcContainer", 10 );
} </script> ... <body onload="return onPageLoad();">
           <div id="pwrSrcContainer"">
...

The PowerIndicator widget was built using the Intel Web 2.0 TDK.

Copyright © Intel Corporation