大学生
最后登录1970-1-1
在线时间 小时
注册时间2016-8-10
|
楼主 |
发表于 2017-7-19 17:58:53
|
显示全部楼层
这是GPIO.c里面的部分
- __IO uint16_t ADC_ConvertedValue;
- /*--------------------------------------------------------------------------------*/
- #define true 1
- #define false 0
- extern int BPM; // óÃà′½óêÕÂö3åËùÂêused to hold the pulse rate
- extern int Signal; // ½óêüÎ′′|àíμÄêy¾Yholds the incoming raw data
- extern int IBI = 600; // ὸö·åÖμ¼äμÄ걼䣬±ØDëóDDÄÂêholds the time between beats, must be seeded!
- unsigned char Pulse = false; // μ±Âö3åÎa¸ßμçƽê±ÎaÕ棬μíê±Îa¼ùtrue when pulse wave is high, false when it's low
- extern char QS = false; // becomes true when Arduoino finds a beat.
- int rate[10]; // êy×éóÃóú½óêÕ×îoó10¸öIBIêy¾Yarray to hold last ten IBI values
- unsigned long sampleCounter = 0; // óÃóúÅD¶ÏÂö3åê±3¤used to determine pulse timing
- unsigned long lastBeatTime = 0; // óÃóúIBIused to find IBI
- int P =512; // ·åÖμused to find peak in pulse wave, seeded
- int T = 512; // ×îμíÖμused to find trough in pulse wave, seeded
- int thresh = 512; // μ±Ç°ê±¿ìDÄÂêÖμused to find instant moment of heart beat, seeded
- int amp = 100; // Âö3åÕñ·ùused to hold amplitude of pulse waveform, seeded
- int Num;
- unsigned char firstBeat = true; // used to seed rate array so we startup with reasonable BPM
- unsigned char secondBeat = false; // used to seed rate array so we startup with reasonable BPM
- /*----------------------------------------------------------------------------------------------------------------------------*/
复制代码
这是main()里面的部分
- #define true 1
- #define false 0
- char QS = false;
- int BPM;
- extern int Signal;
- int IBI = 600;
- // ADC1×a»»μÄμçÑ1Öμí¨1yDMA·½ê½′«μ½SRAM
- extern __IO uint16_t ADC_ConvertedValue;
- // èí¼tÑóê±
- void Delay(__IO uint32_t nCount)
- {
- for(; nCount != 0; nCount--);
- }
复制代码 |
|