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

Project PDL

Project PDL

The PDL of the project is shown in Figure 6.55. The project consists of a main program and two functions called Newline and Text_To_User. Function Newline sends a carriage-return and line-feed to the serial port. Function Text_To_User sends a text message to USART. The main program receives two numbers and the operation to be performed from the PC keyboard. The numbers are echoed on the PC monitor. The result of the operation is also displayed on the monitor.

Function Newline:
 START
  Send carriage-return to USART
  Send line-feed to USART
 END
Function Text_To_Usart
 START
  Get text from the argument
  Send text to USART
 END
Main program:
 START
  Configure USART to 9600 Baud
  DO FOREVER
   Display “CALCULATOR PROGRAM”
   Display “Enter First Number: ”
   Read first number
   Display “Enter Second Number: ”
   Read second number
   Display “Operation: ”
   Read operation
   Perform operation
   Display “Result= ”
   Display the result
  ENDDO
 END


Figure 6.55: Project PDL

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


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