Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 1Winter Quarter Software Design Project Lecture 29.

Slides:



Advertisements
Similar presentations
C Language.
Advertisements

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect FXP. 1Winter Quarter Course Wrap Up and Final Review Topics Lecture.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 12P. 1Winter Quarter User-Written Functions.
Engineering EG167C - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect M1 P. 1Winter Quarter Midterm I Review.
An Introduction to C Adam Gleitman – IAP 2014.
Handy Board. Why the Handy Board Designed to be the controller of small, mobil robots Has many features that make it ideal for robotics projects –Integrated.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect FXP. 1Winter Quarter Course Wrap Up and.
Engineering H193 - Team Project Gateway Engineering Education Coalition Lab 3P. 1Spring Quarter IR & Servos Lab 3.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 29P. 1Winter Quarter Software Design Project.
Engineering H193 - Team Project Gateway Engineering Education Coalition P. 1 Spring Quarter 2008 Robot Programming Tips Week 4 Day 2 By Matt Gates and.
C Programming Basics Lecture 5 Engineering H192 Winter 2005 Lecture 05
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 6 - Arrays Outline 6.1Introduction 6.2Arrays.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 30P. 1Winter Quarter ENG H193 & H193A Projects.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 13P. 1Winter Quarter Scope of Variables.
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
Software Design Project
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 11P. 1Winter Quarter Arrays Lecture 11.
Chapter 6 C Arrays Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc. Arrays are data structures.
1 ICS103 Programming in C Lecture 2: Introduction to C (1)
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect M1 P. 1Winter Quarter Midterm I Review Topics.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 6P. 1Winter Quarter I/O in C Lecture 6.
 2007 Pearson Education, Inc. All rights reserved C Arrays.
CSE1301 Computer Programming: Revision. Topics Type of questions What do you need to know? About the exam Exam technique Sample questions.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect FXP. 1Winter Quarter Course Wrap Up and.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 26P. 1Winter Quarter Handy Board Lecture.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 9P. 1Winter Quarter Switch Case Structures.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering.
Engineering H193 - Team Project Gateway Engineering Education Coalition P. 1 Spring Quarter Week 6 Day 2 Lecture on and Examples of Electrical Circuits.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 15P. 1Winter Quarter Arrays and Pointers.
Timers and Interrupts Shivendu Bhushan Sonu Agarwal.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lab 7P. 1Winter Quarter Stop Light Lab 7.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 14P. 1Winter Quarter Pointers Lecture 14.
CIS Computer Programming Logic
Types for Programs and Proofs Lecture 1. What are types? int, float, char, …, arrays types of procedures, functions, references, records, objects,...
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 30P. 1Winter Quarter H193 Project Lecture 30.
Goals of Course Introduction to the programming language C Learn how to program Learn ‘good’ programming practices.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
Lecture 2 Fundamental Data Types. Variable Declaration.
Chapter 6 Arrays Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 24P. 1Winter Quarter C++ Lecture 24.
Higher Grade Computing Studies 3. High Level Language Constructs Higher Computing Software Development S. McCrossan 1 Simple Data Types Integer: An integer.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics Lecture 5.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 26P. 1Winter Quarter Handy Board Lecture 26.
Engineering H193 - Team Project Gateway Engineering Education Coalition Lab 1P. 1Spring Quarter Introduction to Sensors Lab 1.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering Problem Solving and Logic.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 12P. 1Winter Quarter User-Written Functions Lecture 12.
Copyright © – Curt Hill Types What they do.
 2007 Pearson Education, Inc. All rights reserved C Arrays.
Structured Programming (4 Credits) HNDIT Week 2 – Learning Outcomes Design an algorithmic solution for simple problem such as computation of a factorial,
Aside: Running Supplied *.java Programs Just double clicking on a *.java file may not be too useful! 1.In Eclipse, create a project for this program or.
Lecture 15: Course Review BJ Furman ME 30 16MAY2011.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 11P. 1Winter Quarter Arrays Lecture 11.
int [] scores = new int [10];
C++ Programming Lecture 14 Arrays – Part I The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
Channel Capacity Bandwidth – In cycles per second of Hertz – Constrained by transmitter and medium Data rate – In bits per second – Rate at which data.
Introduction to Programming in RobotC
A variable is a name for a value stored in memory.
CSCE 206 Structured Programming in C
Revision Lecture
Stop Light Lab 7 Winter Quarter.
IR & Servos Lab 3 Spring Quarter.
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
Chapter 6 - Arrays Outline 6.1 Introduction 6.2 Arrays
C Arrays.
Building Java Programs
DATA TYPES There are four basic data types associated with variables:
Presentation transcript:

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 1Winter Quarter Software Design Project Lecture 29

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 2Winter Quarter 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

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 3Winter Quarter The Handy Board

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 4Winter Quarter The Sharp GP1U5 IR Receiver

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 5Winter Quarter 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

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 6Winter Quarter 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 IR Receiver IR Transmitter 6 to 12 inches

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 7Winter Quarter The IR Beacon Signal IR Beacon Signal "Digitized" copy of signal X X 0 1 Time

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 8Winter Quarter 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

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 9Winter Quarter 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.

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 10Winter Quarter 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.

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 11Winter Quarter 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

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 12Winter Quarter 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

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 13Winter Quarter 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.

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 14Winter Quarter 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

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 15Winter Quarter 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"?

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 16Winter Quarter The "Noisy" IR Beacon Signal IR Beacon Signal "Digitized" copy of signal X X X X X 0 1 Time X X X X X X X X

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 17Winter Quarter 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

Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 18Winter Quarter 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