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

2.4 SUMMARY                                21

             EXAMPLE 2.4
             An analog pressure sensor is connected to one of the analog-to-digital (ADC) input ports of a mi-
             crocontroller. Additionally, an LCD display is connected to the output ports. It is required to read
             the pressure every second and then display on the LCD. Show the required algorithm using a PDL
             and also draw the equivalent flow chart. Assume that the display routine is a subprogram called
             DISPLAY.
             Solution 2.4
             The required PDL is:
                 BEGIN
                     DO FOREVER
                           Read Temperature from ADC port
                           CALL DISPLAY
                           Wait 1 second
                     ENDDO
                 END
                 BEGIN/DISPLAY
                      Display temperature on LCD
                 END/DISPLAY


              The required flow chart is shown in Fig. 2.17.






















            FIG. 2.17  Flow chart solution.


                                            2.4 SUMMARY

              In this chapter we have learned about the following:

            • Program development cycle
            • Hardware development cycle
   30   31   32   33   34   35   36   37   38   39   40