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 pacemaker_FINAL_v1 by
constants.h
00001 #include "mbed.h" 00002 #include "rtos.h" 00003 #include "TextLCD.h" 00004 #include <stdio.h> 00005 #include <stdlib.h> 00006 00007 #define RUN 0x1 00008 00009 TextLCD lcd(p15, p16, p17, p18, p19, p20, TextLCD::LCD16x2); 00010 Serial pc (USBTX, USBRX); 00011 00012 // ports 00013 DigitalIn VGet(p11); 00014 DigitalIn AGet(p12); 00015 DigitalOut VPace(p13); 00016 DigitalOut APace(p14); 00017 PwmOut speaker(p21); 00018 00019 // LEDs 00020 DigitalOut leds[] = {LED1, LED2, LED3, LED4}; 00021 // 1 = VP 00022 // 2 = AP 00023 // 3 = VS 00024 // 4 = AS 00025 00026 // input stuff 00027 char input; 00028 00029 // heart rate global vars 00030 int HR = 0; 00031 int beats = 0; 00032 int sampleRate = 10000; // default 10 seconds 00033 int firstSample = 1; 00034 int Omode = 0; 00035 00036 // Normal Values 00037 const int N_PVARP = 325; // ms 00038 const int N_VRP = 300; // ms 00039 const int N_LRI = 857; // ms (= about 70ppm) 00040 const int N_AVI = 65; // ms 00041 const int N_UB = 100; // 100ppm 00042 const int N_LB = 40; // 40ppm 00043 00044 // Exercise Values 00045 const int E_PVARP = 175; // ms 00046 const int E_VRP = 150; // ms 00047 const int E_LRI = 428; // ms (= about 140ppm) 00048 const int E_AVI = 30; // ms 00049 const int E_UB = 175; // 175ppm 00050 const int E_LB = 100; // 100ppm 00051 00052 // Sleep Values 00053 const int S_PVARP = 500; // ms 00054 const int S_VRP = 475; // ms 00055 const int S_LRI = 1333; // ms (= about 45ppm) 00056 const int S_AVI = 100; // ms 00057 const int S_UB = 60; // 60ppm 00058 const int S_LB = 30; // 30ppm 00059 00060 // Heart Values - Normal Mode is default 00061 int PVARP = N_PVARP; 00062 int VRP = N_VRP; 00063 int LRI = N_LRI; 00064 int AVI = N_AVI; 00065 int UB = N_UB; 00066 int LB = N_LB; 00067 00068 // status flags 00069 int isVRP = 0; 00070 int isPVARP = 0; 00071 int inManual = 0; 00072
Generated on Sun Jul 17 2022 14:01:37 by
1.7.2
