Professional Documents
Culture Documents
Arduino DIY Heart Beat PDF
Arduino DIY Heart Beat PDF
www密l身过婆z密那o验
60 100 [1]
3 Timeout
( [2])
1000
iPhone
[3]
LED
Arduino
x86 DEBUG
40mv 5V
USB
10%
1%
Taobao
Arduino
PulseSensor 120
+ 45
Arduino
3V
1602 I2C
USB
USB
4 Pin Vcc GND Output Enable
Enable Pin Single Arduino Digital Pin 2 I2C 1602
A4 A5 Arduino UNO
10 10
60
#include <Wire.h>
#include "LiquidCrystal_I2C.h"
int i;
void setup()
{
pinMode(beatPin,INPUT); //Low for heart beat
Serial.begin(9600);
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.print("Wish you health");
void loop()
{
TimeOut:
startTimer=millis();
for (i=0;i<beatNumber;i++)
{
lcd.setCursor(2,1);
if (millis()-showChar>1000UL) { //Chang running char every 1000ms
switch (nextChar) {
case 0:
lcd.print("*");
break;
case 1:
lcd.print("|");
break;
case 2:
lcd.print("/");
break;
case 3:
lcd.print("-");
} // End of if
showChar=millis();
nextChar=(nextChar +1) % 4;
}
xx
1. http://zh.wikipedia.org/zh-cn/
2. http://jianshen.panjk.com/201311/20131101390106.shtml
3. http://app.cnmo.com/iphone/20915/