Table of Contents
Code StructureThe Processing environment uses one of the files as the base class, and all other classes included in the project are inner classes of this file.
The main program files are:
- Main file, contains drawing loop and global variables.
- All controller input handling, as well as deciding which input to use.
- Contains all code pertaining to the GUI and handling it's input.
- Dialog for reconfiguring controller layout.
- Responsible for all output of state.
The main storage files are:
- Stores controller or GUI input for use by GUI and output.
- Stores all ontroller configuration data, including default controls.
All other PDE files are helper classes, or extensions partially .implemented:
- Same as JoySet.pde, but for keyboard. Does nothing but display itself currently.
- An ActionListener for the MSA menu items, containing the filename.
- A combination label/combobox or label/textfield. For use in KeySetup and JoySet dialogs.
EnvironmentThe code is meant to be placed inside the Processing sketchbook, in a folder named "LVE". Inside this folder is one named "MSA", which contains the image of the controller, as well as the files needed for the MSA. Currently, this is a .msa file, and a 420x200 .jpg image.
MSA FileThe MSA file is made up of two parts. The first is the image to use, and the second is a list of motors separated by line. This list includes their placements, sizes, and labels. It should be structured like so, where Negative corresponds to one direction of the servo, and Positive the other:
[For each servo]NegativeLeft, NegativeTop - NegativeRight, NegativeBottom; PositiveLeft, PositiveTop - PositiveRight, PositiveBottom; "negative label" "positive label"
This is the top left corner of the button, followed by the bottom right, for two buttons. This gives a button for each direction of the servo.
An example file, for the claw implemented by 11213:
204,118-288,130; 110,118-167,130; "MSAForward" "MSABack"
275,88-314,100; 335,88-369,100; "Close" "Open"
Wireless MessageThis is the message sent from the PC through the WOCCS to the Arduino. There are two forms. One for the MSA instruction, and another for all other instructions.
MSA Instruction: 00The MSA instruction requires 3 bytes. In this case, instruction will always be 00.
| Instruction | Unused | |MSAHigh| |MSALow|
|-----2bit----|--6bit--| |-8bit--| |-8bit-|
MSAHigh and MSALow are bytes, 1-hot encoding the states of the MSA servos. Again, + corresponds to one direction of the servo, and - the other. For MSALow, the structure is as follows.
| MSA4+ | MSA4- | MSA3+ | MSA3- | MSA2+ | MSA2- |
MSA1+ | MSA1- |
MSAHigh is similar, but for MSA5 to MSA8.
Other instructionsAll other instructions require only a single byte, and are structured as follows:
|Instruction | Sign | Speed|
- Left Motor = 01;
- Right Motor = 10;
- Break = 11;
- Positive: 0
- Negative: 1
- 5bit integer
InstallationThis program was written in Processing 1.2.1. It may work in other versions, but there can be no guarantee. Please use the links provided on this page to be sure you have the correct version.
To Install and Run
- Download all Software
- Install Processing, following its documentation
- Unzip the LVEGui zip file to the Processing
- NOTE : the sketchbook folder can be found by opening Processing and going to File->Preferences
- Start Processing (Or restart if already open)
- In Processing, go to File->Sketchbook->LVE. The LVE program will open in a new window. You can now close the original Processing window.
- Connect Logitech Dual Action to the computer, and install any drivers if necessary
- Connect WOCCS board, and install CC1111 driver from Software/cc1111drivers.zip
- In the new Processing window, click the play button.
- A popup will ask which control scheme to use. Select the one you want from the drop down menu and click OK.
- Another popup will appear. This will ask which communications port to use. Select the port that the WOCCS is connected to.
- A final popup will open, asking which LVE to use. The LVE we have built is LVE 1.
Things to finishArranged in order of importance:
- Implement multiple LVE configuration
- Implement calibration
- Implement Keyboard control
- Remove cancel button from control selection dialog
- Fine tune values, and perhaps implement an external file for settings like acceleration multiplier.
- Refactor some things, removing the requirement to pass around a reference to the main PApplet
- Move to a single instance of LVE_InputMessage. It should be passed into the function, modified, and returned.
- Make cross platform
- Currently, the joypad library used shows the controller having a different ordering of buttons depending on the OS. Two different default control schemes would have to be added.