1 / 18

Software Design Project

Software Design Project. Lecture 29. ENG H192 Software Design Project. Problem: Detect frequency of IR transmitter Two-person teams will -- Design Code Test Document Teams will be provided -- Handy Board Sharp GP1U5 IR receiver Access to IR transmitter beacon. The Handy Board.

gene
Download Presentation

Software Design Project

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Software Design Project Lecture 29 Winter Quarter

  2. ENG H192 Software Design Project • Problem: Detect frequency of IR transmitter • Two-person teams will -- • Design • Code • Test • Document • Teams will be provided -- • Handy Board • Sharp GP1U5 IR receiver • Access to IR transmitter beacon Winter Quarter

  3. The Handy Board Winter Quarter

  4. The Sharp GP1U5 IR Receiver Winter Quarter

  5. General Description • Your software must detect each of five (5) possible frequencies of transmitted IR light • Frequency detected must be displayed on Handy Board LCD screen • Frequencies will in the range of 20 to 150 Hz • No frequency will be closer than 20 Hz to any other possible frequency • Transmitted frequency will change automatically and randomly to one of the other possible frequencies Winter Quarter

  6. 6 to 12 inches IR Receiver IR Transmitter IR Transmission and Reception • Program should continuously detect frequency of the transmitting beacon • Handy Board screen should display received frequency in Hertz as an "integer" value • Only one of the specified frequencies (or 0) should be displayed Winter Quarter

  7. The IR Beacon Signal IR Beacon Signal 1 X X X X X X X X 0 X X X X X X X X X X X X "Digitized" copy of signal Time Winter Quarter

  8. A Possible Approach • Take a number of measurements of the received signal at regular intervals • Determine how long it took to take those measurements • Analyze set of measurements • Display appropriate frequency • Repeat Winter Quarter

  9. Useful Handy Board Functions • digital (p) -- Returns the value of the sensor connected to digital port "p" as a true/false value. • The parameter "p" should be in the range of 7 through 15, matching port to which receiver is connected • Note that "true" = zero volts, which is sometimes called "active low" • start_button ( ) -- Returns the value of the start button. "True" when button is pressed. Winter Quarter

  10. Useful Handy Board Functions • stop_button ( ) -- Returns the value of the stop button. "True" when button is pressed. • mseconds ( ) -- Returns a long integer value representing the system time in milliseconds. • Like the seconds ( ) function, but data type of returned value is long & units are milliseconds • reset_system_time ( ) -- Resets the count of system time to zero milliseconds. Winter Quarter

  11. Interactive C • Remember, there are things that are different in IC (compared to ANSI C): • No function prototypes • Limited formats possible in printf • Array bounds checked at run time • No #include statements • Smaller set of allowable data types -- only int, long, float, char, and struct (v3.2 only) • Character strings are supported, but simple char variables are not Winter Quarter

  12. Interactive C • More things that are different in IC (compared to ANSI C): • No switch/case construct • Can only do +, -, and * on long int • All source files must be compiled together • #define has global scope • User functions come first in source file • No do/while construct • No mixed mode arithmetic Winter Quarter

  13. Design Project "Deliverables" • List of brainstorming ideas • Neatly written algorithm and/or flow chart of user-written functions • Documentation package which includes: • A description of the program for use by developers, complete with a list of variable names and uses • A description of the program for use by a general user with an abstracted discussion of the program. Winter Quarter

  14. Receiving in a "Noisy" World • Real world communications are affected or "degraded" by noise, for example: • Normal conversations in a busy public place • Cell phones in fringe reception areas ("Can you hear me now?"™) • AM radio stations during thunderstorms • Often measured as a "signal-to-noise" ratio which is usually called SNR • Almost all forms of communication are range dependent -- longer range => lower SNR Winter Quarter

  15. Receiving in a "Noisy" World • The IR transmitter and receiver system we are using is "range dependent" • How does light intensity vary as a function of distance? • IR receiver "drops out" if transmitted signal is too weak • What does "drops out" mean? • Can we improve our ability to "see"? Winter Quarter

  16. The "Noisy" IR Beacon Signal IR Beacon Signal 1 X X X X X X X X X X X 0 X X X X X X X X X X X X X X "Digitized" copy of signal Time Winter Quarter

  17. A Possible "Noisy" Approach • Take a number of measurements of the received signal at regular intervals • Determine how long it took to take those measurements • Analyze set of measurements and ignore periods that are shorter than average • Compare results of several sets (Steps 1 - 3) • Display appropriate frequency • Repeat from beginning Winter Quarter

  18. Possible Programming Pitfalls • Failing to use global variables, particularly for medium or large arrays • Scarcity of comments in code (comments don’t take any memory space) • Improper use of Handy Board functions • Not using modular approach to designing code • Too much floating point arithmetic • Too much code – exceed memory of Handy Board Winter Quarter

More Related