Interface & Application Programming


This week, we focused on interface and application programming. Our assignment was to write an application that interfaces with an input or an output device. This week I connected a button to my Fabduino and interfaced with Processing. I spent some time experimenting with Processing and decided to try using a library I found called HE_mesh. HE_mesh is a 3D mesh library; a mesh created in HE_mesh can be exported as an STL to another 3D modeling program for further manipulation or fabrication.
Materials and tools:
  • Fabduino
  • Button
  • Arduino IDE
  • Processing IDE
  • HE_Mesh library for Processing

Fabduino & button.
I followed a SparkFun tutorial to connect Arduino to Processing. The tutorial explains how to send data from Arduino to Processing over the serial port, and also how to send data from Processing to Arduino. Most of the work this week related to writing code to make my interface look and behave as desired — connecting Arduino with Processing was actually pretty straightforward (except for some lag issues, described below).
Processing and Arduino Sketches
When the button was pressed, Processing re-rendered the geodesic sphere with new directional light (changing from night into day). I encountered some problems with lag in Processing when sending data across the Serial port. Initially, I was flooding the Serial port with Strings indicating whether or not the button was pressed, but that made the Processing sketch lag quite a bit and seem pretty unresponsive. To solve this problem, I reported only changes in button state to Serial from Arduino, and read those state changes in Processing.
Processing application reacting to button press
I really love the idea of creating generative 3D meshes with Processing, and am excited to keep playing with the HE_mesh library now that I understand some of the basics!