how to make (almost) anything



Interface & Application Programming


Week 13 Tools/Resources:
Unity
Processing

Serial Port tutorials:
Part 1
Part 2
Part 3



Unity Intro

I had high hopes for this week--especially since, this was supposed to be a "light" week--but it seems to be ending in frustration. Diego was saint, and recorded a great series of video tutorials for the Arch group this week, introducing us to the basics of Unity, and to writing code in C# to connect Unity graphics to a serial input of some kind. I chose to use the touch capacitive slider as my input device, which I fabricated for Networking Week.




While following the tutorials, I ran into a few issues. First, when I went to adjust some of the .NET settings to match Diego's instructions, changning those options were grayed out options for me. Searching online, I found a Unity discussion board that brought up similar issues. One person had success by switching first to a deprecated version of the .NET settings:




Doing this caused Unity to ask to quit and restart>When I reopend the program, the options were no longer inaccessable, and I could switch them to match the .NET 4.X settings.

C#

Recreating Diego's C# code along with the tutorial was really helpful. I was recieving an error with Diego did not, involving the use of 'Ports'. Double checking for errors, I found none. Totally frustrating. When in doubt, restart, which fixed the problem.





When finally going to build the code, more Port errors were raised, stating the the Port namespace could not be found:




When in doubt, restart, which fixed the problem. On to linking up with my input device! I was able to recieve notice that the usb port was connected, but using the capactive touch slider apparently didn't send data that Unity was expecting, but it was clearly sending data:

Format Exception: Input string was not in a correct format.


Serial data: incoming but incoherent

I eavesdropped on office hours between Diego and Nathaniel for a while on Monday night, and Nathaniel may have been having similar issues at first with his incomming data (until Diego thoroughly worked over the code). Diego seemed to think that this had something to do with the way Neil had structured gathering information in his code for the capacitive touch boards, which I believe Diego said contained characters and not just integers. I'd like to get this to work, but it will require getting more help with the coding.

Processing Sketch

Diego's 3rd tutorial introduced Processing briefly and uploaded code based on an example on the Processing website we could tailor to our input devices. The only thing that needed altering to get the thing up an running was specifying the serial port your device was using. If you play the sketch, then a list of USB ports will be created, from which you can choose. Diego's code specified number 9 on his list, the port i was connected to was [1] in the array.




Playing the script with the capacitive slider worked...sort of. It's really jumpy, but it's definitely is scaling and registering values in the top left corner. In the stills below the video, you are able to see what is happening more clearly. Unknown characters do appear to be popping up, which may tie back to the issues I was encountering in Unity.