|
Re: Wiring Maxbotix ultrasonic sensor to serial on cRIO?
We are using the same sensor on our robot. I wired it so it would give an Analog voltage(white wire on a PWM to pin 3) and plugged it into the analog module on the cRIO. In the code, I did:
Code:
AnalogChannel *UltrasonicSensor;
UltrasonicSensor = new AnalogChannel(1);
float Distance = UltrasonicSensor->GetVoltage();
I don't remember the conversion from voltage to feet offhand but that can be figured out with a bit of testing.
Heres the datasheet for the sensor. Read the pin out section of the sensor and wire accordingly. http://www.maxbotix.com/documents/HR..._Datasheet.pdf
__________________
2015
Suffield Shakedown Winners & Most Points Scored
South Florida Regional 6th Seed, #5 Alliance Captains, Regional Winners w/ 2383 & 386, Innovation in Control Award
NY Tech Valley Regional 5th Seed, QF, Excellence in Engineering Award
SBPLI Long Island Regional 4th Seed, Finalists

Hopper Division 14th Seed, QF
|