Книга: Advanced PIC Microcontroller Projects in C

Project PDL

Project PDL

The project PDL is shown in Figure 6.47. The program consist of two parts: function getkeypad and the main program. Function getkeypad receives a key from the keypad. Inside the main program the two numbers and the required operation are received from the keypad. The microcontroller performs the required operation and displays the result on the LCD.

Function getkeypad:
 START
  IF a key is pressed
   Get the key code (0 to 15)
   Return the key code
  ENDIF
 END
Main program:
 START
  Configure LCD
  Wait 2 seconds
  DO FOREVER
   Display No1:
   Read first number
   Display No2:
   Read second number
   Display Op:
   Read operation
   Perform operation
   Display result
   Wait 5 seconds
  ENDDO
 END


Figure 6.47: Project PDL

Оглавление книги


Генерация: 0.436. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз