Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-rtos TextLCD
Revision 4:242a71a6efed, committed 2015-11-30
- Comitter:
- shibulal
- Date:
- Mon Nov 30 20:29:58 2015 +0000
- Parent:
- 3:ac2e5aceb324
- Child:
- 5:a74776e6504f
- Commit message:
- a
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Nov 30 17:59:05 2015 +0000
+++ b/main.cpp Mon Nov 30 20:29:58 2015 +0000
@@ -45,10 +45,13 @@
const int sportsModeLRI = 600;
const int manualModeURI = 343;
const int manualModeLRI = 2000;
+int low[4] = {30,40,100,30};
+int high[4] = {60,100,175,175};
int pulses = 0;
int pacemakerInterval = 10;
+int newpacemakerInterval;
int heartInterval = 10;
-int pacemakerRate = 0;
+int paceMakerRate = 0;
int heartRate = 0;
int LRI = normalModeLRI;
int URI = normalModeURI;
@@ -92,6 +95,10 @@
}
else if (input=='O'){
mode='O';
+ input=pc.getc();
+ newpacemakerInterval=10*(int)input;
+ input=pc.getc();
+ newpacemakerInterval=newpacemakerInterval+(int)input;
Pmm.signal_set(0x1);
Thread::signal_wait(0x1);
}
@@ -139,7 +146,7 @@
Pmki.signal_set(0x1);
}
else if (mode=='O'){
- //not sure what to do here
+ pacemakerInterval=newpacemakerInterval;
Pmki.signal_set(0x1);
}
else if (mode=='M'){
@@ -234,7 +241,7 @@
}
void updatePacemaker(){
int temp = 60/pacemakerInterval;
- pacemakerRate = pacemakerRate + temp;
+ paceMakerRate = paceMakerRate + temp;
}
void PaceMakerDisplay(void const *args){
osEvent evt;
@@ -262,16 +269,16 @@
updatePacemaker();
}
else {
- if (pacemakerRate < low[mode]){
+ if (paceMakerRate < low[mode]){
r.reset();
paceMakerRate=0;
}
- else if (pacemakerRate >= low[mode] && pacemakerRate <= high[mode]){
+ else if (paceMakerRate >= low[mode] && paceMakerRate <= high[mode]){
//high alarm
r.reset();
paceMakerRate=0;
}
- else if (pacemakerRate > high[mode]){
+ else if (paceMakerRate > high[mode]){
//low alarm
r.reset();
paceMakerRate=0;
@@ -538,7 +545,7 @@
VpaceLED=0;
}
lcd.cls();
- lcd.printf("%d", pacemakerRate);
+ lcd.printf("%d", paceMakerRate);
Thread::wait(15);
};
}