![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Final project 4180 Spring 2017 Heart Rate detection interfaced with bluetooth and MATLAB for signal processing. By: Prashanth Collapancheri and Venu Ganti
Dependencies: PulseSensor mbed
main.cpp@0:d17435173db6, 2017-05-01 (annotated)
- Committer:
- vganti6
- Date:
- Mon May 01 02:49:08 2017 +0000
- Revision:
- 0:d17435173db6
Final project 4180 Prashanth Collapancheri Venu Ganti;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vganti6 | 0:d17435173db6 | 1 | #include "mbed.h" |
vganti6 | 0:d17435173db6 | 2 | |
vganti6 | 0:d17435173db6 | 3 | AnalogIn pulseIn(p20); |
vganti6 | 0:d17435173db6 | 4 | Serial pc(USBTX,USBRX); |
vganti6 | 0:d17435173db6 | 5 | Serial bluemod(p9,p10); |
vganti6 | 0:d17435173db6 | 6 | float pulses = 0.0; |
vganti6 | 0:d17435173db6 | 7 | |
vganti6 | 0:d17435173db6 | 8 | int main() { |
vganti6 | 0:d17435173db6 | 9 | char buffer[128]; |
vganti6 | 0:d17435173db6 | 10 | |
vganti6 | 0:d17435173db6 | 11 | while(1) { |
vganti6 | 0:d17435173db6 | 12 | pulses = pulseIn.read(); |
vganti6 | 0:d17435173db6 | 13 | printf("%0.4f\n", pulses); |
vganti6 | 0:d17435173db6 | 14 | if(pc.readable()){ |
vganti6 | 0:d17435173db6 | 15 | if(bluemod.writeable()){ |
vganti6 | 0:d17435173db6 | 16 | bluemod.printf("%c",pc.getc()); |
vganti6 | 0:d17435173db6 | 17 | } |
vganti6 | 0:d17435173db6 | 18 | } |
vganti6 | 0:d17435173db6 | 19 | wait_ms(5); |
vganti6 | 0:d17435173db6 | 20 | } |
vganti6 | 0:d17435173db6 | 21 | } |
vganti6 | 0:d17435173db6 | 22 |