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

8.2  PROJECT 1—TWO-DIGIT MULTIPLEXED 7-SEGMENT LED       137























            FIG. 8.3  Circuit diagram of the project.








                  BEGIN
                         Group PORT C pins as a single variable
                         Define the segment bit patterns
                         Configure PC_8 and PC_9 as outputs
                         CNT = 25
                         DO FOREVER
                                Extract the MSD digit of CNT
                                Extract the LSD digit of CNT
                                Send bit pattern corresponding to MSD to PORT C
                                Enable MSD Digit
                                Wait for 10ms
                                Disable MSD Digit
                                Send bit pattern corresponding to LSD to PORT C
                                Enable LSD Digit
                                Wait for 10ms
                                Disable LSD Digit
                         ENDDO
                  END
            FIG. 8.4  Program PDL.
   146   147   148   149   150   151   152   153   154   155   156