Design Example - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Design Example

Description:

Alarm Clock. Features??? Include 'standard' functions. battery operated? 120/240 volts AC ... Lights - AM/PM, Alarm Ready, Time Digits. Display - digit scanning ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 16
Provided by: jtc5
Category:
Tags: alarm | clock | design | example

less

Transcript and Presenter's Notes

Title: Design Example


1
Design Example
  • Alarm Clock

2
Features???
  • Include
  • standard functions
  • battery operated?
  • 120/240 volts AC
  • both
  • accuracy?

3
(No Transcript)
4
(No Transcript)
5
Specification
  • Classes - top level
  • Mechanism - for the device operation
  • Buttons - device buttons
  • Speaker - buzzer
  • Lights - AM/PM, Alarm Ready, Time Digits
  • Display - digit scanning etc.

6
Initial Class Diagram
7
Class Refinements
8
Mechanism Class
  • Track current time
  • Track current alarm time
  • Track current alarm on/off status
  • Use a time display resolution of one minute

9
Mechanism Class
10
Update Time() Behavior
11
Scan keyboard() behavior
12
Two major software components
  • An interrupt-driven routine can update the
    current time
  • A timer can be used to interrupt periodically
    and update the time

13
Two major software components
  • A foreground program can poll the buttons and
    execute their commands
  • foreground program will read the button values
    and then use simple conditional tests to
    implement the commands

14
Two major software components
  • Commands
  • setting the current time
  • setting alarm time
  • setting the alarm
  • turning off the alarm
  • Another routine called by the foreground program
    will turn the buzzer on and off based on the
    alarm time

15
Foreground Code
Write a Comment
User Comments (0)
About PowerShow.com