Montag, 16. März 2015

Lab 5 - Processing

Oscillating circle with Processing

  1. Processing is based on Java
  2.  a local variable is defined and can only be called within a function. A global variable is defined outside of a function and any function can call it.
  3. None, since it is a void method.
  4. In short, the code makes sure that the ellipse stays within the bounds of the screen. Since the ellipse only moves along the y axis, only the y coordinate has to be checked while the x coordiante can be ignored. Thus, this code makes sure that the ellipse stays within bounds by checking that y (indicating the center of the ellipse) plus the radius of the ellipse never exceed the height (600) and that y minus the radius of the ellipse never is lower than the top border (0). Once the ellipse reaches either limit, its direction is reversed.

Sending Serial Data from an Arduino Circuit to a Processing Application

Etch a Sketch
(sorry for the bad quality. The blogspot upload compressed it a lot. I hope you can see it!)