ThermistorPack.

Dependents:   Pachube_TestProgram ThermistorPack_TestProgram _DearMrJeffMourich StarBoardOrangeExpansion2 ... more

Revision:
0:ac6a05fefa2f
Child:
1:4f84f03b1703
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ThermistorMCP9701.cpp	Fri Sep 17 23:42:46 2010 +0000
@@ -0,0 +1,22 @@
+/**
+ * Sensor interface driver. (Version 0.0.1)
+ *
+ * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems)
+ * http://shinta.main.jp/
+ */
+
+#include "ThermistorMCP9701.h"
+
+ThermistorMCP9701::ThermistorMCP9701(PinName pin)
+        : analogInput(pin) {
+}
+
+ThermistorMCP9701::~ThermistorMCP9701() {
+}
+
+double ThermistorMCP9701::read() {
+    /*
+     * The value range of analogInput.read() is 0.0 to 1.0.
+     */
+    return (((analogInput.read() * 3.3) - 0.400) / 0.0195);
+}