-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspo2_monitor.ino
57 lines (46 loc) · 1.19 KB
/
spo2_monitor.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//adding libraries for various devices used
#include <Adafruit_GFX.h>
#include <MCUFRIEND_kbv.h>
#include <SPI.h>
#include <SD.h>
#include <FreeDefaultFonts.h>
#include <Fonts/FreeSans12pt7b.h>
#include <CircularBuffer.h>
//#include <TouchScreen.h>
#define YP A3
#define XM A2
#define YM 9
#define XP 8
#define MINPRESSURE 10
#define MAXPRESSURE 1000
#define DISPLAY_WIDTH 480
#define DISPLAY_HEIGHT 320
//TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
MCUFRIEND_kbv tft;
//colours used
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
CircularBuffer<int,120> spo2_data;
CircularBuffer<int,120> hr_data;
void setup() {
// put your setup code here, to run once:
init();
Serial.begin(9600);
tft.reset(); // hardware reset
uint16_t ID = tft.readID(); // read ID from display
Serial.print("ID = 0x");
Serial.println(ID, HEX);
if (ID == 0xD3D3) ID = 0x9481; // write-only shield
tft.begin(ID); // LCD gets ready to work
tft.setRotation(1);
draw();
}
void loop() {
// put your main code here, to run repeatedly:
}