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.
Fork of Versuch20 by
Diff: Classes/IRSensorK.cpp
- Revision:
- 2:efa9a78591da
- Parent:
- 0:b886f13e4ac6
- Child:
- 5:64d7b4b69fdf
diff -r 6ef5bc60e69c -r efa9a78591da Classes/IRSensorK.cpp
--- a/Classes/IRSensorK.cpp Mon Apr 23 16:18:41 2018 +0000
+++ b/Classes/IRSensorK.cpp Wed Apr 25 11:16:16 2018 +0000
@@ -1,27 +1,32 @@
#include <cmath>
#include "IRSensorK.h"
+//------------------------------------------------------------------------------
+
using namespace std;
- IRSensorK::IRSensorK(AnalogIn& distance):
-
- distance(distance) {
-
-
- }
+IRSensorK::IRSensorK(AnalogIn& distance):
+
+ distance(distance)
+{
+
+
+}
- IRSensorK::~IRSensorK() {}
-
- int IRSensorK::read() {
- int d;
+IRSensorK::~IRSensorK() {}
+
+//------------------------------------------------------------------------------
+
+int IRSensorK::read()
+{
+ int d;
if (3300*(distance)> 400) { //3cm+
d=1;
- }
- else {
+ } else {
d=0;
- }
-
+ }
+
return d;
-
- }
\ No newline at end of file
+
+}
\ No newline at end of file
