that is why you don’t recognize the terminal type. You’ll
have to tweak your code to put out the correct line-terminating character to get a single reading on a single
line with your favorite terminal emulator.
Notice the readings. They range from 19193 to 28028.
These are timer clocks in an Arduino’s 16 MHz system. With
each clock being 62. 5 ns, this is a servo pulse range of 1.2
ms to 1.75 ms. I was rotating the gyro back and forth to
get these readings. Figure 4 shows my setup. I generate a
servo pulse of 1.5 ms on PD7 which is fed to the PG-03
gyro and reads the results back on ICP1 (PB0).
If you are using a gyro similar to that shown in Figure
1, you could still use an interrupt to handle the readings.
You would just use the vector 22 ADC_vect interrupt which
would get the analog value of the output of the gyro
breakout board. The same holds true for reading your
accelerometer, if it’s like the one shown in Figure 5. That’s
the Pololu MMA7260QT breakout board (recently obsolete
and replaced by a newer device). Technology keeps
changing and it constantly amazes me that between the
time I buy a new widget and the time I use it, it’s obsolete!
The source for the gyro program can be found at the
SERVO Magazine website: under Mr. Roboto as rcgyro.zip.
As always, if you have a question for Mr. Roboto, drop me
a line at firstname.lastname@example.org and I’ll be happy to
try to answer it! Have fun and keep building robots! SV
Figure 5. Three-axis accelerometer.
SERVO 01.2011 17