Page 242 - ARM Based Microcontroller Projects Using MBED
P. 242

228                          8. INTERMEDIATE LEVEL PROJECTS




































                 FIG. 8.100  The generated waveform.




                 The program consists of an endless loop. Inside this loop, a for loop is used to iterate 10 times.
                 Inside this for loop, 10 steps are generated where the width of each step is 2ms. Therefore, as
                 shown in Fig. 8.100, the period of the generated sawtooth waveform is 20ms. In this figure, the
                 vertical axis is 1V/division and the horizontal axis is 5ms/division.


                              8.30 PROJECT 25—TRIANGULAR WAVEFORM

                 8.30.1 Description

                   In this project, we generate a triangular waveform with 100 steps going up and 100 steps
                 coming down. The step width is set to 100μs, that is, the period of the generated triangular
                 waveform is 20ms.


                 8.30.2 Aim
                   The aim of this project is to show how a triangular waveform can be generated.
   237   238   239   240   241   242   243   244   245   246   247