Hexiwear heart rate sensor demo

Dependencies:   MAX30101

Fork of Hexi_Accelero_Magneto_Example by Hexiwear

Committer:
DimiterK
Date:
Tue Aug 30 22:13:42 2016 +0000
Revision:
4:acdc72fe9dcf
Parent:
3:9f60cb7455c4
Child:
5:2e1700fc3386
First commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
maclobdell 0:207337d58f96 1 #include "mbed.h"
DimiterK 4:acdc72fe9dcf 2 #include "MAX20101.h"
maclobdell 0:207337d58f96 3
GregC 2:f9c24c129575 4 // Check out the full featured example application for interfacing to the
GregC 2:f9c24c129575 5 // Accelerometer/Magnetometer device at the following URL
GregC 2:f9c24c129575 6 // https://developer.mbed.org/users/trm/code/fxos8700cq_example/
maclobdell 1:6da908234299 7
GregC 2:f9c24c129575 8 DigitalOut led1(LED_GREEN);
GregC 2:f9c24c129575 9
GregC 2:f9c24c129575 10 // Initialize Serial port
GregC 2:f9c24c129575 11 Serial pc(USBTX, USBRX);
maclobdell 0:207337d58f96 12
maclobdell 0:207337d58f96 13 // Pin connections & address for Hexiwear
DimiterK 4:acdc72fe9dcf 14 MAX30101 heart(PTB1, PTB0);
maclobdell 0:207337d58f96 15
maclobdell 0:207337d58f96 16 int main() {
maclobdell 0:207337d58f96 17
DimiterK 4:acdc72fe9dcf 18 printf("MAX301010 sensor test....\r\n\r\n");
GregC 2:f9c24c129575 19 wait(0.5);
GregC 2:f9c24c129575 20
DimiterK 4:acdc72fe9dcf 21 heart.enable();
DimiterK 4:acdc72fe9dcf 22
GregC 2:f9c24c129575 23 while (1) {
maclobdell 0:207337d58f96 24 led1 = !led1;
maclobdell 0:207337d58f96 25 // Example data printing
DimiterK 4:acdc72fe9dcf 26 printf("ID 0x%02x\r\n", heart.getRevisionID());
maclobdell 0:207337d58f96 27
maclobdell 0:207337d58f96 28 Thread::wait(500);
maclobdell 0:207337d58f96 29 }
maclobdell 0:207337d58f96 30 }