Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: SensorControl/lineSensor.h
- Revision:
- 4:208f5279143a
- Parent:
- 3:01b5e80d842d
- Child:
- 5:f1613df66ceb
diff -r 01b5e80d842d -r 208f5279143a SensorControl/lineSensor.h
--- a/SensorControl/lineSensor.h Sat Mar 09 14:27:48 2019 +0000
+++ b/SensorControl/lineSensor.h Sat Mar 23 19:46:09 2019 +0000
@@ -1,6 +1,5 @@
class lineSensor
{
-
private:
DigitalOut emitter;
@@ -45,12 +44,12 @@
{
turnOn();
sampler.attach(callback(this, &lineSensor::turnOff),sampleTime);
- calcLineVoltage();
}
- void calcLineVoltage(void)
+ float calcLineVoltage(void)
{
- lineVoltage = receiver.read() * vREF;
+ lineVoltage = receiver.read()*vREF;
+ return lineVoltage;
}
float returnLineVoltage(void)