Measuring a Pulse Width

I ran a quick test this morning and measured how long it took to output a simple printf command. It takes 940 uS to complete this command:

printf("counter: %d
", counter); // counter is an unsigned int

It takes 5.3 mS to output this command:

printf("Dean Kamen is the inventor of the Segway Human Transporter.
");

It takes 3.14 mS to output IFI’s printf example.

printf("PWM OUT 7 = %d, PWM OUT 8 = %d
",(int)pwm07,(int)pwm08);  /* printf EXAMPLE */

Thank you everyone for all your help. Yesterday I was able to successfully integrate the PING))) sonar sensor and the mini-RC. The problems I was having were solved by using two I/O pins and using interrupt 1. I tried staying clear of interrupt 1 because Kevin Watson’s encoder code uses it. Friday I will look into reducing the I/O required to 1 and figure out why I can’t use a different interrupt.

My ultimate goal was to release this code and a white paper as an easy to implement system alongside Mr. Watson’s code. I’ll try as best as I can to avoid I/O’s already used by his code. Look for a white paper in a couple weeks.

First off let me say congratulations on your success!! I love seeing people stay focused on a goal regardless of the difficulties they encounter along the way.

I have always been an impatient person. Waiting to read your white paper is almost more than I can stand :ahh: Just kidding!!!
Is it possible that you can give a quick description on how you used two I/O pins on a device that shares one pin as both an In and Out (trigger and signal).

Looking forward to reading you white paper. Please post a note here when it’s ready to read.