Home Biography Projects Final Project
Title

This week I will create the interface that I will use for my final project. It will communicate with a 32U4 over USB to control the various modules of my final project. I will create the interface using C# for windows forms in Visual Studio.

Visual Studio
Visual Studio is a development enviroment created by Microsoft for the development of windows appliacations. I am using the free Community version, since the full version is pretty expensive. The only limitations on this version is that I cannot use this version to write commercial software, and few minor features might be missing as well. It can be downloaded from this website.

Making the Interface
The first thing I do is create a new Windows Forms application and name it something descriptive, such as "ConsoleFunctionTest." I then expand the displayed window in the design tab so that I have space to work. I then place all of the fields ,dropdown boxes, and checkboxes that I think I will need. I also placed some group borders just to make the application look a little more organized.

The backend of the interface is written in C#. It first opens a COM serial port, and then sends the values in the text bokes to the controller board. The interface program will then wait for a serial response containing the state of each of the toggle switches located on the front of my final project.

Board Code
The code for the board loops through a check of the front panel toggle switches, and sets a boolean value based on the state of each. It also loops through a button check and sets an integer value based on which swiitch was pressed. When serial data is received, the microcontroller first reads the value for the seven segment display, processes it so that the display controller can use it, and sends it over I2C. The LCD data is then narrowed down to two lines based on the button information collected earlier, and sends it over I2C, placing a '|' character at the end of each line. The board proceeds to send the toggle switch data to the computer in the form of "on" and "off" strings.

Testing
The first thing I do is to un the program using either the exe file or the run button in VS. I add some test lines and click the send button. It would look like this, but with test lines:

After waiting for the board to send data back, it should look like this:

and my final project looks like this:

Files
All files can be found on my Final Project page, but here are a few for easy accessability:
ConsoleTestProgram.zip - The interface I wrote
MainControl.ino - Board-Side code for my final project.