Quote:
Originally Posted by Ether
The bottom of Page3 of the User's Guide for 2760342 implies that the SIG pin is a "Serial Monitor (9600)". Sounds like RS-232 to me, not PWM. Am I misinterpreting this?
|
I think that's talking about opening the serial monitor in the Arduino programming environment, so you that you can read the data that the Arduino code is sending over the serial port.
Here's the relevant portion of the arduino code for reading the sensor.
Code:
/*Begin the detection and get the pulse back signal*/
void Ultrasonic::DistanceMeasure(void)
{
pinMode(_pin, OUTPUT);
digitalWrite(_pin, LOW);
delayMicroseconds(2);
digitalWrite(_pin, HIGH);
delayMicroseconds(5);
digitalWrite(_pin,LOW);
pinMode(_pin,INPUT);
duration = pulseIn(_pin,HIGH);
}