Hexiwear heart rate sensor demo

Dependencies:   MAX30101

Fork of Hexi_Accelero_Magneto_Example by Hexiwear

Committer:
DimiterK
Date:
Sun Sep 04 22:41:32 2016 +0000
Revision:
5:2e1700fc3386
Parent:
4:acdc72fe9dcf
First release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
maclobdell 0:207337d58f96 1 #include "mbed.h"
DimiterK 5:2e1700fc3386 2 #include "MAX30101.h"
maclobdell 0:207337d58f96 3
maclobdell 1:6da908234299 4
DimiterK 5:2e1700fc3386 5 DigitalOut led1(LED_BLUE);
GregC 2:f9c24c129575 6
DimiterK 5:2e1700fc3386 7 Serial pc(USBTX, USBRX);// Initialize Serial port
maclobdell 0:207337d58f96 8
DimiterK 4:acdc72fe9dcf 9 MAX30101 heart(PTB1, PTB0);
maclobdell 0:207337d58f96 10
maclobdell 0:207337d58f96 11 int main() {
maclobdell 0:207337d58f96 12
DimiterK 5:2e1700fc3386 13 pc.printf("MAX301010 sensor test....\r\n\r\n");
GregC 2:f9c24c129575 14 wait(0.5);
GregC 2:f9c24c129575 15
DimiterK 4:acdc72fe9dcf 16 heart.enable();
DimiterK 4:acdc72fe9dcf 17
GregC 2:f9c24c129575 18 while (1) {
maclobdell 0:207337d58f96 19 led1 = !led1;
maclobdell 0:207337d58f96 20 // Example data printing
DimiterK 5:2e1700fc3386 21 pc.printf("ID 0x%02x\r\n", heart.getRevisionID());
maclobdell 0:207337d58f96 22
maclobdell 0:207337d58f96 23 Thread::wait(500);
maclobdell 0:207337d58f96 24 }
maclobdell 0:207337d58f96 25 }