- Processing is based on Java.
- A global variable is able to be referenced at any point in a program, whereas a local variable can only be referenced within the function in which it was declared (and will consequently disappear when the function ends)
- The draw() function returns a void data type.
- The code below the "//keep the circle in bounds" comment checks to see if the circle has gone to or past the top or bottom of the window. The variable y refers to the center of the circle, so y - (diameter/2) is the y-coordinate for the top of the circle, and y + (diameter/2) is the y-coordinate for the bottom of the circle, so when the top of the circle hits the top of the window (at y-coordinate zero) or when the bottom of the circle hits the bottom of the window (at y-coordinate "height"), the y-speed reverses.
3. Etch-A-Sketch
This circuit uses a potentiomenter and a photoresistor to create a 'sketch' through Processing.
No comments:
Post a Comment