int16_t AP_RangeFinder_SRF04::read(){ // _trigger->write(0); // _sched->delay_microseconds(1000); // _trigger->write(1); // _sched->delay_microseconds(1000); getDistanceCentimeter(); }
/// <summary> /// isFarther: check whether the distance to the detected object is smaller than a given threshold /// </summary> boolean DistanceGP2Y0A21YK::isFarther(int threshold) { if (threshold<getDistanceCentimeter()) { return true; } else { return false; } }
/// <summary> /// isCloser: check whether the distance to the detected object is smaller than a given threshold /// </summary> boolean DistanceGP2Y0A21YK::isCloser(int threshold) { if (threshold>getDistanceCentimeter()) { return (true); } else { return (false); } }
/// <summary> /// isFarther: check whether the distance to the detected object is smaller than a given threshold /// </summary> bool AP_RangeFinder_SRF04::isFarther(int threshold) { if (threshold<getDistanceCentimeter()) { return true; } else { return false; } }
/// <summary> /// isCloser: check whether the distance to the detected object is smaller than a given threshold /// </summary> bool AP_RangeFinder_SRF04::isCloser(int threshold) { if (threshold>getDistanceCentimeter()) { return (true); } else { return (false); } }
/// <summary> /// isFarther: check whether the distance to the detected object is bigger than a given threshold /// </summary> boolean DistanceSensor::isFarther(int threshold) { if (threshold>getDistanceCentimeter()) { return true; } else { return false; } }