summaryrefslogtreecommitdiffstats
path: root/LineSensor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'LineSensor.cpp')
-rw-r--r--LineSensor.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/LineSensor.cpp b/LineSensor.cpp
new file mode 100644
index 0000000..a269fa1
--- /dev/null
+++ b/LineSensor.cpp
@@ -0,0 +1,16 @@
+#include "LineSensor.h"
+
+#include "adc.h"
+
+
+LineSensor::LineSensor(int id) {
+ this->id = id;
+
+ updateValue();
+}
+
+float LineSensor::updateValue() {
+ value = getADCValue(id)/1024.0;
+
+ return value;
+}