Added battery voltage level readout & SHT11 low-voltage indicator
This commit is contained in:
parent
ceb2554d2f
commit
de601c9523
4 changed files with 51 additions and 11 deletions
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: CollectServer.java,v 1.8 2008/09/03 13:35:21 nifi Exp $
|
||||
* $Id: CollectServer.java,v 1.9 2008/11/10 21:14:20 adamdunkels Exp $
|
||||
*
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
|
@ -34,8 +34,8 @@
|
|||
*
|
||||
* Authors : Joakim Eriksson, Niclas Finne
|
||||
* Created : 3 jul 2008
|
||||
* Updated : $Date: 2008/09/03 13:35:21 $
|
||||
* $Revision: 1.8 $
|
||||
* Updated : $Date: 2008/11/10 21:14:20 $
|
||||
* $Revision: 1.9 $
|
||||
*/
|
||||
|
||||
package se.sics.contiki.collect;
|
||||
|
@ -271,6 +271,31 @@ public class CollectServer {
|
|||
return data.getTemperature();
|
||||
}
|
||||
},
|
||||
new TimeChartPanel(this, "Battery Voltage", "Battery Voltage",
|
||||
"Time", "Volt") {
|
||||
{
|
||||
setRangeTick(1);
|
||||
setRangeMinimumSize(4.0);
|
||||
setGlobalRange(true);
|
||||
setMaxItemCount(defaultMaxItemCount);
|
||||
}
|
||||
protected double getSensorDataValue(SensorData data) {
|
||||
return data.getBatteryVoltage();
|
||||
}
|
||||
},
|
||||
new TimeChartPanel(this, "Battery Indicator", "Battery Indicator",
|
||||
"Time", "Indicator") {
|
||||
{
|
||||
chart.getXYPlot().getRangeAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits());
|
||||
setRangeTick(5);
|
||||
setRangeMinimumSize(10.0);
|
||||
setGlobalRange(true);
|
||||
setMaxItemCount(defaultMaxItemCount);
|
||||
}
|
||||
protected double getSensorDataValue(SensorData data) {
|
||||
return data.getBatteryIndicator();
|
||||
}
|
||||
},
|
||||
new TimeChartPanel(this, "Relative Humidity", "Humidity", "Time", "%") {
|
||||
{
|
||||
setMaxItemCount(defaultMaxItemCount);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: SensorData.java,v 1.4 2008/08/29 10:00:23 nifi Exp $
|
||||
* $Id: SensorData.java,v 1.5 2008/11/10 21:14:20 adamdunkels Exp $
|
||||
*
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
|
@ -34,8 +34,8 @@
|
|||
*
|
||||
* Authors : Joakim Eriksson, Niclas Finne
|
||||
* Created : 3 jul 2008
|
||||
* Updated : $Date: 2008/08/29 10:00:23 $
|
||||
* $Revision: 1.4 $
|
||||
* Updated : $Date: 2008/11/10 21:14:20 $
|
||||
* $Revision: 1.5 $
|
||||
*/
|
||||
|
||||
package se.sics.contiki.collect;
|
||||
|
@ -169,6 +169,14 @@ public class SensorData implements SensorInfo {
|
|||
return -39.6 + 0.01 * values[TEMPERATURE];
|
||||
}
|
||||
|
||||
public double getBatteryVoltage() {
|
||||
return values[BATTERY_VOLTAGE] * 2 * 2.5 / 4096.0;
|
||||
}
|
||||
|
||||
public double getBatteryIndicator() {
|
||||
return values[BATTERY_INDICATOR];
|
||||
}
|
||||
|
||||
public double getRadioIntensity() {
|
||||
return values[RSSI];
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: SensorInfo.java,v 1.1 2008/08/29 09:00:15 nifi Exp $
|
||||
* $Id: SensorInfo.java,v 1.2 2008/11/10 21:14:20 adamdunkels Exp $
|
||||
*
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
|
@ -34,8 +34,8 @@
|
|||
*
|
||||
* Authors : Joakim Eriksson, Niclas Finne
|
||||
* Created : 20 aug 2008
|
||||
* Updated : $Date: 2008/08/29 09:00:15 $
|
||||
* $Revision: 1.1 $
|
||||
* Updated : $Date: 2008/11/10 21:14:20 $
|
||||
* $Revision: 1.2 $
|
||||
*/
|
||||
|
||||
package se.sics.contiki.collect;
|
||||
|
@ -76,7 +76,9 @@ public interface SensorInfo {
|
|||
public static final int BEST_NEIGHBOR = 20;
|
||||
public static final int BEST_NEIGHBOR_ETX = 21;
|
||||
public static final int BEST_NEIGHBOR_RTMETRIC = 22;
|
||||
public static final int BATTERY_VOLTAGE = 23;
|
||||
public static final int BATTERY_INDICATOR = 24;
|
||||
|
||||
public static final int VALUES_COUNT = 23;
|
||||
public static final int VALUES_COUNT = 25;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue