test publish

Dependencies:   mbed GroveEarbudSensor

Committer:
age2pierre
Date:
Fri Mar 25 11:17:39 2016 +0000
Revision:
5:ee265ab0752d
Parent:
3:b4f04b8b8797
Child:
8:e1beb2a9454e
Fix to compile for c++99, added Scale Interface and two scales

Who changed what in which revision?

UserRevisionLine numberNew contents of line
antoineA 0:8bec0f0b673a 1 #include "mbed.h"
age2pierre 3:b4f04b8b8797 2 #include "GroveEarbudSensor.h"
antoineA 0:8bec0f0b673a 3
age2pierre 3:b4f04b8b8797 4 InterruptIn earSensor(p5);
age2pierre 3:b4f04b8b8797 5 DigitalOut led(LED1);
age2pierre 3:b4f04b8b8797 6
age2pierre 3:b4f04b8b8797 7 void printHeartRate(float heartrate,void *data) {
age2pierre 3:b4f04b8b8797 8 printf("Callback: heartrate = %.1f\r\n",heartrate);
age2pierre 3:b4f04b8b8797 9 }
antoineA 0:8bec0f0b673a 10
antoineA 0:8bec0f0b673a 11 int main()
antoineA 0:8bec0f0b673a 12 {
age2pierre 3:b4f04b8b8797 13 GroveEarbudSensor earbud(&earSensor);
age2pierre 3:b4f04b8b8797 14 earbud.registerCallback(printHeartRate);
age2pierre 3:b4f04b8b8797 15
age2pierre 3:b4f04b8b8797 16 while(true) {
age2pierre 3:b4f04b8b8797 17 led = !led;
antoineA 1:4249509c28d1 18 wait(0.5);
antoineA 0:8bec0f0b673a 19 }
antoineA 0:8bec0f0b673a 20 }