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

FIG. 8.48  An example game.




                               BEGIN/MAIN
                                     Configure LED1 as output
                                     Attach serial communication link to function ISR
                                     dly = 0.1 seconds
                                     DO FOREVER
                                           LED ON
                                           Wait dly seconds
                                           LED OFF
                                           Wait dly seconds
                                     ENDDO
                               END/MAIN


                               BEGIN/ISR
                                     Read a character from the keyboard
                                     IF the character = ‘+’ THEN
                                           dly = dly + 0.1
                                           IF dly > 1 second THEN
                                                  Dly = 0.1s
                                           ENDIF
                                     ENDIF
                               END/ISR
                 FIG. 8.49  Program PDL.
   195   196   197   198   199   200   201   202   203   204   205