Monday, April 23, 2007

Actions, Events, and Filtering

I wrote a program in processing that reacts to how vigorously you shake an accelerometer.

The arduino communicates the sensor's readings through a serial connection to processing. I used a smoothing function, in my arduino code, to get clean values from the accelerometer, which tends to give very eradict readings otherwise.


calm
Originally uploaded by 0x000000.
When you first open up the processing app, it is a calm, blue day.



planting
Originally uploaded by 0x000000.
If you make it so that the sensor's readings match up on the x- and y-axis, you plant flowers on the screen.



blowing
Originally uploaded by 0x000000.
Slightly shaking it causes the blooms to blow...



storm
Originally uploaded by 0x000000.
Quickly shaking it causes a rain storm (and all the flowers blow away)


Leaving the sensor alone for 10 seconds let's the storm go away, returning you to a clear day.

Download Processing and Arduino code

1 comment:

Anonymous said...

Great work.