What I would do is first to get the sensor connected, and print the analog values of the sensor.
Hold the sensor in different positions, and shake it to see what the values do.
You want to write a full program without having the sensor. That will be hard.
The way you want to read the angle doesn't seem right.
The shaking and vibration of the dryer causes higher values then the angle.
If the dryer is off, you are reading the angle.
There are many examples for an analog acceleration sensor and the Arduino.
My suggestion is to determine the shaking of the sensor. For example reading samples at 200 Hz (I think somewhere between 2 and 1000 Hz is good), and check only the difference with the previous values from the analog inputs. Convert the difference of the 3 axis to a single 'g'-force value.
// Just as an example, not tested.
static int old_x, old_y, old_z;
int new_x, new_y, new_z;
int delta_x, delta_y, delta_z;
new_x = analogRead(xPin);
new_y = analogRead(yPin);
new_z = analogRead(zPin);
delta_x = new_x - old_x;
delta_y = new_y - old_y;
delta_z = new_z - old_z;
g = sqrt ( sq(delta_x) + sq(delta_y) + sq(delta_x) );
g /= SENSITIVITY_VALUE; // convert to real 'g' according to sensor sensitivity;
old_x = new_x; // remember the value for the next sample
old_y = new_y;
old_z = new_z;
That value should be near zero if the dryer is off. If the dryer is on, you might get perhaps 0.5 to 3 'g' (just a guess).
Once you have that, you can use the average 'g'-force during 10 seconds or during 1 minute.
An other part is the delay and sequence. This can easily be programmed in the Arduino. You could add a button to simulate the washing machine, and test the delay.
The normal delay ( http://www.arduino.cc/en/Reference/delay
) is in milliseconds. So you could wait 1 minute like this:
delay (60L * 1000L); // wait 1 minute
The 'L' is to indicate that it is a long integer.