Skip to content

Commit

Permalink
Update emergency_stop.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
wesen02 committed Mar 18, 2023
1 parent 6a81f59 commit 0b871ed
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions include/emergency_stop.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@

#include <wiringPi.h>
#include <sys/time.h> // gettimeofday
#include <unistd.h> // sleep/usleep

#include <iostream>

using namespace std;

class e_stop
Expand All @@ -30,30 +27,22 @@ class e_stop
digitalWrite(TRIG, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG, LOW);
// usleep(10);
// digitalWrite(TRIG, LOW);

if (waitValue(0))
{
double pulseStart = getTime();

// std::cout << "pulseStart" << pulseStart << "\n";

if (waitValue(1))
{
double pulseEnd = getTime();

double duration = pulseEnd - pulseStart;
double distance = duration * coefficient;
// std::cout << "duration" << duration << "\n";

return distance;
}
}

// std::cout << "Measurement error!"
// << "\n";

return 0.0 / 0.0;
}

Expand Down

0 comments on commit 0b871ed

Please sign in to comment.