Genuino 101 Tilt Sensor Alarm Using inbuilt Accelerometer

So currently, I have the following components.

  • Genuino 101 (Has inbuilt Accelerometer)

So currently, I have the following components.

  • Genuino 101 (Has inbuilt Accelerometer)
  • Resistors
  • Red LED
  • Green LED
  • Piezobuzzer
  • Jumper Wires

So basically, I have attempted many times to build a function where the normal state of the system is that the Green LED is on.

In scenarios when the accelerometer exceeds 25 degrees in angle, along all axis, I wish for the red light to go on and the Piezobuzzer to set off an alarm until the genuino has returned to an angle less than 25 degrees.

bump