Due: Jan. 20, 2014 at 12:00 noon.
This assignment will not be graded, but you are required to complete it and submit it regardless. This is intended to ensure that you know how to submit your assignments correctly and to help resolve any technical issues before it becomes important and your assignments are worth something.
The primary piece of software for programming is known as the "Development Environment", which includes a collection of tools for creating, editing, compiling, testing and debugging programs as well as supporting libraries used by your program. There are many good development environments available, including Visual Studio, XCode and Eclipse. While these are mostly equivalent for our purposes, and code written using any of them should work just fine on another, they each have their idiosyncracies so in most situations where code in a project will be written by more than one person or will be written by one and tested by another it is strongly advised to standardize on a particular development environment.
In this course, we have chosen an open-source cross-platform environment that will provide both a low-cost solution, and a platform agnostic solution. This will keep costs down for you, the student.
The purpose of this assignment is to get you familiarized with the development environment and have all aspects of the environment working properly.
Part 1 - Executable
This part of the assignment should be done individually. In this part of the assignment you will modify, compile, and execute a simple program composed of the following three files:
- This file contains a main function which calls the printName() function.
- This file contains the declaration for the printName() function.
- This file contains the definition (implementation) of the printName() function.
You will edit
assign0.cpp so that the comment block
contains your own name and student number and so that it prints your
After you have tested your program and are confident it is right, you will submit the assignment using a web-based submission system.
- Do this assignment during the scheduled lab time in room EN-3000.
- Your lab instructor will lead you through these instructions during your lab time.
- Start Eclipse.
- Create a new workspace by (a) selecting Browse, (b) creating a folder called "workspace" in your "My Documents" folder, and (c) selecting that folder as your workspace. Note that on LabNet computers this will appear as the H: drive, so your workspace should be H:\My Documents\workspace
- Create a C++ project in Eclipse for this assignment (call it A0). Be sure to select "Empty Project" under "Executable" for project type and the MinGW GCC or MacOSX GCC toolchain.
- Download the three files a0main.cpp, assign0.h, & assign0.cpp
and save them in the project folder
My Documents\workspace\A0in your workspace
- Select the project (A0) in the Eclipse "project explorer" view (on the left) and press the F5 key to refresh the project.
assign0.cppby double clicking on it in the "project explorer" view.
- Change the comment block to contain your name, login name, student number, section number, and the due date.
- Look for the line
cout << "Your Name";
Change the text between the quotes to be your name.
- Save the file by pressing ctrl-s or by the "File -> Save" menu item.
- Build the project by the "Project -> Build All" menu item or the (build) toolbar button.
- Check the "console" view at the bottom, for any errors.
- Run the project by the "Run -> Run" menu item or the (run) toolbar button.
- If the output (in the "console" view at the bottom) is "Hello your name", where "your name" is replaced by your name, then your program runs correctly.
- Submit the file
H:\My Documents\workspace\A0\assign0.cppusing websubmit.
Part 2 -- Pololu 3pi
This part of the assignment should be done in your programming pairs. In this part you will modify a simple C++ program and compile it and run it on the Pololu 3pi. The program is contained in assign0_3pi.cpp (only one file this time). Here are the detailed instructions (assuming that you've created a workspace and have all the tools installed correctly).
- Create a C++ project, this time selecting "Empty Project" under "AVR Cross Target Application".
- Ensure that
pololu_atmega328pis specified as a required library for the project.
- Download the file assign0_3pi.cpp
and save it in the project folder under
assign0_3pi.cppto fix the comment block and change the message to something that identifies you.
- Compile the program ()
- Ensure that your 3pi has fresh batteries installed correctly, is turned on and is connected to the programmer, which is connected to the PC USB port.
- Download your program to the 3pi by selecting the (AVR) button, it should start to execute immediately.
Please DO NOT submit this code. If it works for you then that's good enough.
Last modified $LastChangedDate: 2014-01-09 13:57:57 -0330 (Thu, 09 Jan 2014) $