Alarm Clock Hack, interfacing with Servo, Input Signals, and Motion Sensor

Z3R0:
This is what I have come up with so far... it's now getting stuck on the reset sequence. I think its actually where my servo should return back to 0. It seems like it starts too then the arduino locks up. I put the pos to 0 instead of 175 in the else command... I dont know where its doing it now...

Probably because you are calling a function that's located in the code after the main loop that is apparently attempting to jump to the beginning of your entire code, including the include statement and initial definitions... The loop() function is a prepetual loop, so it will eventually go back to the beginning of the loop without any reset function. If you absolutely want to jump around your code, and while it isn't necessary for this sketch it's occasionally useful, use the goto command instead of trying to do it in assembly.

However a better way would be to get rid of the reset function and instead have the "if (proxState >= 1)" code block as follows...

 if (proxState >= 1) {
    buzzerState = 0;
    delay(500);
    digitalWrite(ledPin1, HIGH);
    myservo.write(0);
    delay(500);
    digitalWrite(ledPin1, LOW);
    delay(200);
    digitalWrite(ledPin1, HIGH);
    delay(200);
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin, LOW);
    digitalWrite(buzzerPin, LOW);
    delay(10000);
    pos = 0;
 }