Trick for treat .. the illusion of proving you are alive .. and alive enough to even enjoy a treat.
This particular project is a carry over from a request to simply 3D print a heart for a 4th grade class demonstration -- and after negotiations negated instead reanimating a heart in a lightning storm .. uh, with an Arduino obviously .. we (me) pitched a pulse driven beating heart .. that in turn rewards your having proved to subsist, with a treat.
Notations 1. 'Clear watermelon' filament .. (>_ლ) 2. Censored #$@*!$#% about people, places and things. 3. Extensive modification of https://3dwarehouse.sketchup.com/mod... by Profesor D. 4. Did not earn a TVShow episode bcz .. it had been done. 5. Original concept included a candy dispenser that required evidence of life.
lcd.begin(16, 2); lcd.setCursor(0, 0); lcd.print("Dead or Alive?");
}
void loop() { // Motor and Buzzer Switch On/Off aux_state = digitalRead(aux);
// Reset Value tot = 0; nxt = 0; set_bpm = 0;
// Smoothing Pulse for (int n = 0; n <= 5; n++) { for (int i = 0; i <= 25; i++) { val = analogRead(pulse); tot = val + tot; // Display Per Peak if (val > 580) { // Adjust // If Motor and Buzzer if (aux_state == HIGH) { beat_led(0xff, 0x00, 0x00); delay(bpm_led_delay); // If No Motor and Buzzer } else if (aux_state == LOW) { beat_led_non(0xff, 0x00, 0x00); delay(bpm_led_delay); } } delay(2); } nxt = tot / 25; set_bpm = set_bpm + nxt; } // BPM Maths bpm = set_bpm * 12; // Not Very Accurate .. Meh!