Ultrasonic sensor online mode

I’m trying to use an ultrasonic sensor with the online code on the microcontroller. I control the robot from my PC with a wireless connector and a C# wrapper I wrote.
Since I’m using the online code I do not ‘have’ a start or get command for the ultasonic. I switch digital output of the sensor from 1 to 0 and see how long it takes for the interrupt port to change from 0 to 1. The problem is that for the same orientation, position of the sensor I get diffrent time spans.
Did anyone try this before or have any ideeas?

I use a remote microprocessor to talk to the Vex. To get the ultrasound to work I wrote a routine that runs on the Vex that does the ultrasound start, the ping and the check on the response. That routine then returns the distance to the master controller. There was too much latency to do it with the master in control.

Start with the VEX Sensor Test, found on the Support Page. The Two ‘C’ source files can be used to update the ‘C’ files in the On-Line Code. Look in the file “user_routines_sensor_test_fast.c” for how the Timing is done.

Also Search here at VexLabs for UltraSonic and at Chief Delphi as well.

A few links that are related are, How to program when using more than two ultrasonic sensors and Accuracy of Ultrasonic range finder.

Thank you for the input. Looks like I have to program the controller after all. My previous attempts were producing slow response times from the controller. I hope the new controller will be available soon and have more processing power. I guess you can only do so much with the VEX.

How did you get your vex microcontroller to communicate with your computor wirelessly? I need to know for one of my projects!


This is what I use for wireless connection: http://www.ipenabled.com/bluetooth-rs232-usb.html
The gizmo comes with a transformer to power the serial part. To eliminate that restriction you will also need a 4 AA battery pack, an H adaptor from RadioShack and your good to go.
Also do a search on the forums for wireless and see what other products have been tried.