using the same circuit in the previous post, the arduino source code is only changed, and for viewing output
Block diagram:
Arduino Code for Heart rate measurement
int val, beat;
int count = 0;
unsigned int previoustime;
unsigned int currentime;
float del;
void setup()
{
Serial.begin(9600);
//lcd.begin(8, 2);
pinMode(A0, INPUT);
pinMode(13, OUTPUT);
//Beat status LED
}
void loop()
{
val =
analogRead(A0);
if (val > 200)
{
count++;
currentime =
millis();
del = currentime -
previoustime;
previoustime =
currentime;
float Q = 1000 /
del;
float fb = 60 *
Q;
Serial.println(fb);
digitalWrite(13,
HIGH);
delay(400);
}
else
{
digitalWrite(13,
LOW);
}
}
Front panel
No comments:
Post a Comment