Exemplo n.º 1
0
int16_t AP_RangeFinder_SRF04::read(){
	//    _trigger->write(0);
	//	_sched->delay_microseconds(1000);
	//	_trigger->write(1);
	//	_sched->delay_microseconds(1000);		
	getDistanceCentimeter();
}
Exemplo n.º 2
0
/// <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;
	}
}
Exemplo n.º 3
0
/// <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);
	}
}
Exemplo n.º 4
0
/// <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;
	}
}
Exemplo n.º 5
0
/// <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);
	}
}
Exemplo n.º 6
0
/// <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;
	}
}