Interactive Installation : Week 4

Mouse Input

Analog Input

These are sensors which give you a range of values. A switch gives you "Yes/No" or "On/Off" information - "Is the buton pressed?" "Is the door open?" "Is there someone sitting in the chair?". An analog sensor tells you "How much" - "How hard is the button being pressed?" "How many people are in the room?" "How close is someone to the sensor?."

The components themselves work by varying electrical current levels in response to different conditions. Most are "variable resistors" - sensors that change their resistance in response to changing levels of light, or sound, or pressure. The interface board (Arduino, EZIO, etc.) converts this changing electrical signal to discrete numbers. So, in your code, what you'll get is a number, usually from 0 to 255.

Classes in Processing

For complex projects, it's good to break a program into smaller pieces so you can work on them individually. A Class is one of these pieces of code. They're handy when you want to make something with a sophisticated behavior - and really handy when you then want to have hundreds of them.

Motion Simulation

Using classes to simulate physical motion of objects: