Site hosted by Angelfire.com: Build your free website today!

  Home

  Introduction
  Key Feature
  Application
  Description
       >Material
       >Circuit
       >Program
       >Case
  Product View
  Troubleshooting
  Reference
  Appendix

Description of  Program

(Bus Stop)

¡@

Flowchart for Bus Stop Program

¡@

Simple description of Bus Stop Program:

    When the program is started, the buffer register and flag will be initialized, and then the main loop waits for the interrupt.

The main loop function is also do the following process:

Check does the minute key pressed.
If yes, add one to minute buffer, else check does the hour key pressed.
If the minute key is pressed, then check does the minute buffer equal to 60.
If yes, change the minute buffer to 0.
If no, then jump to check does the hour key pressed.
If the hour key is pressed, then also add one to hour buffer, else jump to check does the minute key pressed again.
Then check does the hour buffer equal 24.
If yes, change the hour buffer to 0 and jump back to check minuet key again.
When the program is interrupt, reset the timer interrupt after 5ms again.
Check do the bus arrived.
If yes, then set the arrived flag and analyst the code (Refer to Table 3) do which route is arrived.
After that the program will modify the clock display buffer first.
If No, then it will jump to the subroutine to modify the clock display buffer.
After modify the clock display buffer, if the flag is set, modify the route display buffer too then clear the flag.
Finally, send the data from the corresponding buffer to the display, the route and the clock.
If the flag is clear, then skip the modify route display buffer part.
After all, jump back the main loop and continue all procedure.

¡@

Table P3

Route

Code

Null

0

0

0

1

A

0

0

1

2

A

0

1

0

3

A

0

1

1

 

Back

¡@

¡@

¡@

¡@

¡@

¡@

Back