Page 110 - Build Your Own Quadcopter_ Power Up Your Designs with the Parallax Elev-8
P. 110

Chapter 4: Prog ramming the P arallax Propeller Chip           89
































                             Figure 4.18  PWM signal waveform with a 1.5-ms pulse width and 50-Hz rate.


                                The Top Object is delegating clock configuration responsibilities to one of the component
                             objects  referenced by the  reference name  system whose file name is Propeller Board of
                             Education. If you examine the source code for the Propeller Board of Education, you will
                             find nearly the same code that I used in the FastBlinker1 program to set the clock. This
                             delegation approach is useful, and it does minimize the code in the Top Object. It really boils
                             down to your approach to coding, especially if there are multiple Top Objects to be used in
                             a situation such as the Learning Tutorials where this code came from.
                                The next line in the Go method is:

                             servo.Set(14, 0)



















                             Figure 4.19  1 Center Servos Full Source view.
   105   106   107   108   109   110   111   112   113   114   115