View Single Post
  #4   Spotlight this post!  
Unread 18-02-2013, 10:02
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Using VEX Ultrasonic Sensor

There used to be a set of (horribly written) vis in WPIlib to support an ultrasonic encoder with two digital ping/response lines. I believe they still exist, but I'm not sure.

It used the DIO Pulse feature and DIO Interrupt features to generate and listen to a pulse. Unfortunately, it was written to Wait On Interrupt, causing the thread that called the ultrasonic sensor to hang until either a pulse was returned, or the timeout (60ms) was reached.

Unfortunately, the majority of the library is written synchronously with blocking calls like this, which is IMHO really really bad embedded code design.

The FPGA has a lot of rarely or never used features which I have never seen used, including these DIO pulse and interrupt features, and a lot of DMA capabilities.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote