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: TextLCD mbed-rtos mbed
Fork of mbed_PM by
Diff: main.cpp
- Revision:
- 3:0e4473c63935
- Parent:
- 2:926bb514dcae
--- a/main.cpp Tue Dec 01 00:03:10 2015 +0000
+++ b/main.cpp Tue Dec 01 00:48:27 2015 +0000
@@ -1,3 +1,4 @@
+#include <string.h>
#include "mbed.h"
#include "rtos.h"
#include "TextLCD.h"
@@ -9,11 +10,13 @@
DigitalIn Aget(), Vget();
int PacemakerModeGuard = 0;
+int observationInterval = 10000;
void PacemakerSense() {
}
+// Keyboard and ModeSwitch thread
void PacemakerKeyboard() {
while(1) {
char c = keyboard.getc();
@@ -44,6 +47,23 @@
break;
case 'v':
case 'V':
+ if(PacemakerModeGuard == 3) {
+ PacemakerV = 1;
+ Thread::wait(10);
+ PacemakerV = 0;
+ }
+ break;
+ case 'o':
+ case 'O':
+ char buff[3];
+ keyboard.gets(buff, 3);
+ int newObs;
+ if(sscanf(buff, "%i", &newObs) != 0) {
+ observationInterval = newObs;
+ }
+ break;
+ case default:
+ break;
}
}
}
