ENGR2210        17 September 2012

Lab 1.5 - Bidirectional Communication

Due: 20 September


  You have now built a pan and tilt unit, and acquired data.  You no doubt noticed a couple of things when building your system:

If a user wants to perform a partial scan, waiting for a full scan would be frustrating!  Your job in this (half-) lab is to extend Lab 1 with some form of user control via the serial port.  This could include waiting for input before starting a scan, allowing the user to stop the scan, controlling the step size or scan precision, and limiting the pan angles to speed up scans.

Ways to collect data from a user in a PC for sending to an Arduino

There are many ways to enable user control of an Arduino - from simple text commands to graphical user interfaces (GUI). Either way, some message has to be passed to the Arduino over the serial port.  You can ask for a single digit that will influence the scan in some way - or you can parse a packet of data that controls multiple parts of the scan.

Instructors are providing a few tips for getting started using Python. You will need the Python Serial library from http://pyserial.sf.net.

(Windows installers are at http://sourceforge.net/projects/pyserial/files/pyserial/2.5/)

We recommend communicating to the arduino with fixed length messages, to make decoding them simpler.  You will need to check every now and then whether you have received data on the serial port.  If you have received more bytes than required for a single message, you can read and decode a single message.


    Your deliverable for this lab is a PDF of your code, highlighting (or starring, or...) the new sections that handle bidirectional communication.  There should be a very short (a few sentences) description of your modification.  In your section on Thursday, your instructor will talk to you about your approach to bi-directional communication - a key part of the Lab 2 that will be assigned Thursday.