Keyes Heartbeat

Keyes Heartbeat

This page is to Setup and Config Keyes Heartbeat

Hardware and Software

Hardware

Keyes Heartbeat

Software

Arduino IDE

Sanki Notes

    • Keyes Heartbeat; unplug and plug again when pload by Arduino IDE (For Reset)

Examples

This example is Work and Fine

            1. /*

            2. This example will show you how to use the KY-039 heart bear sensor.

            3. Its a simple basic heart beat monitor with a LCD1602A. In this example i did not use a I2C for those who dont have it.

            4. */

            5. double alpha=0.75;

            6. int period=20;

            7. double refresh=0.0;

            8. void setup(void)

            9. {

            10. Serial.begin(9600);

            11. pinMode(A0,INPUT);

            12. }

            13. void loop(void)

            14. {

            15. static double oldValue=0;

            16. static double oldrefresh=0;

            17. int beat=analogRead(A0);

            18. double value=alpha*oldValue+(0-alpha)*beat;

            19. refresh=value-oldValue;

            20. Serial.print(" Heart Monitor ");

            21. Serial.print(" ");

            22. Serial.println(beat/10);

            23. oldValue=value;

            24. oldrefresh=refresh;

            25. delay(period*10);

            26. }