Page 167 - Build Your Own Quadcopter_ Power Up Your Designs with the Parallax Elev-8
P. 167
146 Bu il d Y o ur O w n Q u a d c o p t e r
Figure 6.20 BOE connected to the AR8000 throttle channel.
BOE Pulse-Width Measurements
The first program that I will discuss is named PWM2C_SIGDemo, which measures pulse
width. The program has four separate Spin components that are required for it to execute. I
am showing you only two of the four, since the other two, while needed, do not function in
the actual measurement process. They support text strings and communication with the
Propeller serial Terminal (PSerT) program, which is used to display the results.
The essential listing of the PWM2C_SIGDemo program is:
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
_baudRateSpeed = 250_000
_newLineCharacter = 13
_homeCursorCharacter = 1
_clearToEndOfLineCharacter = 11
_receiverPin = 31
_transmitterPin = 30
_leftServoPin = 14 ‘changed from 0 in the original for the
BOE
_rightServoPin = 15 ‘1 in the original