ST. NORBERT COLLEGE

CS 460: SENIOR CAPSTONE EXPERIENCE IN COMPUTER SCIENCE

SPRING 2003

 

PROJECT PRESENTATION

PC Remote Control

Zac M. Leider

http://compsci.snc.edu/cs460/leidzm/

 

Part 1: Project Description (8-10 minutes)

 

A.     Definition and Requirements

Project Description:

Build hardware and device drivers that will control a personal computer using an ordinary television remote control.

                        Project Requirements:

1.      The system must recognize several popular brand name remote controls.

2.      The system must be able to control an application on a PC remotely.

3.      The system should be able to control an event such as mouse or keyboard in an application.

4.      Investigate using the remote to control OS command (gui and shell).

Detailed Requirements:

Dr. Dobbs Journal, May 2000 – Infrared Control of your PC, by Gavin Smyth http://www.beesknees.freeserver.co.uk/articles/remote-control.html

B.     Solution(s)

I was able to accomplish all the requirements set forth by Dr. Pankratz in the project requirements above.  I do however wish I could have taken a few of those requirements a bit further, but I am more that pleased with the final product I was able to create.  I began working with C++ and MFC to implement my project solution.  Progress was very slow going with MFC and with the guidance of Professor Blahnik I switched over to Visual Basic almost a month and a half into the semester.  I knew this was not going to be an easy task, but like Frederick Brooks says in Chapter 11 of Mythical Man-Month “plan to throw one away.”

With Visual Basic I was able to accomplish what I wanted to do in a much easier fashion and I also picked up the foreign syntax almost immediately.  I know have a program that will read infrared signals (6 byte pattern) from almost any remote you can give it.  I allow the user of the application to program up to five remote controls and it can use these remote controls to perform numerous pre-program actions I have available for them.  These actions include: control of the system mouse, simulation of the keyboard (using a cellular phone type of alphabet), full control of WinAmp and WinDVD and their actions, and shortcuts to program’s exe’s.  I would like to have programmed more applications, but given the time and availability of such codes I am proud of what I have available.

C.     Exceptions

Removed from project requirements by DCP:

5.      Design an application to control the remote so that two personal computers (or a PC and a TV or VCR) can communicate with each other using remote controls.

·        Both Pankratz and I decided that this project was more then enough involved without this additional requirement.

·        Would be an excellent extension/enhancement for future CS460 students, but was really never feasible given the time constraints of the semester.

D.     Methodology

·        Modular Design – Broke overall system down into smaller parts.  My instinctual programming technique would be to just attack the program as a whole.  However, I did my best to resist this instinct.  Instead I made some small programs like one that just opened the comm port, one to just initialize the IRMAN, or a small program that just gains control of the system mouse.

·        Multitasking – The modular design approach led well to the multitasking of my project.  I was able to work on controlling the system mouse while at the same time trying to initialize my IRMAN for example.

·        Focus Small – Once the project got large, similar to the modular design type approach I focus on one small area at a time.  I’d concentrate on one form, function or command at a time.  Once I was satisfied with my results I’d move on to my next goal.

·        Keep Stored Version – I found it very helpful to have a working version stored at all times.  Many times I’d be working on different aspects of my program and get to a point where I was at a dead end.  The “undo” Control+Z can only take you so far back.  It is difficult to remember exactly how you have gotten off track, so a stored working version to go back to was very useful.

 

Part 2: Demonstration (8-10 minutes)

 

            Several aspects of my program will be demonstrated here:

1.      Error checking – demonstrate the several error checks in the initial setup of the program:

·        Comm port already in use.

·        Comm port does not exist.

·        Error in communication with comm port.

2.      Point out use of status bar and audio responses – I believe much cleaner then using message boxes.

3.      Demonstration of initializing a remote

·        Adding a remote.

·        Learning of the controller’s buttons.

·        Binding of pre-programmed actions to those buttons.

·        Removing remotes.

·        Deleting buttons.

·        Unbinding and rebinding or buttons.

4.      Demonstrate use of a programmed remote – show a sampling of programmable actions.

5.      Show help window and about window.

6.      Show sample text document used to store remote.

 

Part 3: Questions & Answers

 

            A good project should induce thought … let’s hope mine can accomplish this!

 

Part 4: Learning and Development Process

 

A.     Strategies

·        All the items found under the methodology section I consider essential to my strategy.

·        I found the Internet quite useful with my project.  To use the SendMessage API call I needed to know certain constants to send applications I wanted to control. (for example - to perform the play action in WinAmp, 40045 needs to be sent to it using the API).  Unfortunately these constants were not easily assessable, but with some extensive searching on the web I was able to find the constants for at least WinAmp and WinDVD.

·        Talking to the CS professors and getting my friends and roommates to use the application was extremely useful.  What makes logical sense in my mind does not necessarily make sense to others.  I have never really done a project that needed to be user friendly, it was always what I wanted it to be.  Bouncing ideas off Dr. McVey, Professor Blahnik and Dr. Pankratz proved to help immensely.  They often asked the questions that inspired many of the design aspects of my project.

B.     Knowledge

·        General programming knowledge – I had never really worked in Visual Basic before, but using the techniques and knowledge I had learned in Visual C++ I was quickly able to pick up VB.  This really was a good example of one of the main foundations of the SNC CS curriculum that knowledge of individual languages is not that important, it’s the concepts we learn that can be applied throughout.

·        Debugging – The testing and debugging involved in this type of program was very important.  There are so many options and instances possible, that I must admit even now I do not believe I have exhausted every possible angle.  However, knowledge of this type of in-depth debugging was crucial to prevent many of the possible errors.

·        Problem solving – My prior knowledge of problem solving helped me with the protecting of certain variables.  When storing, deleting and saving the data, it was important that I knew how to utilize while loops and if statements to accomplish these things properly.

·        Bottom-up design – When I began this project I had a vague idea of what it would ultimately become.  Its design took shape by starting small, at the very simple thing of just opening the comm port.  From there it just grew upward into the final product I have now.

·        Modular design – as I mentioned previously in methodology.

C.     Extensions

·        Utilize threads to improve program (for example -  a thread to check the comm port for data received).

·        As previously mentioned, the communication between two computers would be very interesting addition.

·        Implement more applications with pre-programmed commands.

·        Create a program that just recognizes remotes.  Would search a database of remote commands looking for your remote, and if yours does not exist, the database then grows.

·        Implement a function to cycle through the current windows, allowing you to maximize, minimize or close them at your discretion.  Currently this can be done with the mouse only.  I attempted solving this from three different directions and was unable to get the desired effect (even when working in C++).

D.     Advice

·        Start early and with interest and enthusiasm.  I believe it is much easier to maintain your interest for the duration of the semester if you start with passion, then trying to bust your butt at the end to make up for your initial approach.  Also, the more interest on your part to make the best program possible, the more enjoyable your semester will be, the more effort you will put forth and in turn the more complete result in the end.  It’s a sort of domino effect.

·        Do a better job than I have at updating your web page and your journal.  If you are anything like me this will be difficult.  If I had time this semester to work on my capstone project, I wanted to get at it.  I wanted to solve the current problem I was running into or create the new addition I had in mind.  The last thing I wanted to do with my limited free time was to worry about my web page.  Do your best to resist this temptation, it will pay off in the end.

·        Know when to say when.  The project has got to end sometime.  Take time to work on the presentation and all of the other final aspects.

·        Make the project your own.  I mentioned before that I used the professors to get many ideas, which is true because I, as we all do, tend to think in one direction.  Outside input is necessary to make a user-friendly product, but ultimately the finished product is yours.  Obviously the requirements set forth by Dr. Pankratz must be met, but the project will be much more enjoyable to complete if you put your personal stamp on it.