I have a arduino pro mini and using a Arduino Uno to program it, I have this code as…
- User
I have a arduino pro mini and using a Arduino Uno to program it, I have this code as below and when I want to upload data to it, I get error "Adafruit_GFX.h: No such file or directory" and also I use an OLED.0.96 with SSD1315 driver do all necessary works and changes to code to be uploadable /*
- an oximeter diy. v.0.92 (minor fixes)
- by hacking a ky-039 heartbeat sensor or using an infrared led
- a red led and a photodiode.
- https://hackaday.io/project/170752-oximeter-do-it-yourself */
#include <Wire.h> //#include <LiquidCrystal_I2C.h> #include <SPI.h>
#include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 32 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) #define OLED_RESET 4 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
#define maxperiod_siz 80 // max number of samples in a period #define measures 10 // number of periods stored #define samp_siz 4 // number of samples for average #define rise_threshold 3 // number of rising measures to determine a peak
// a liquid crystal displays BPM //LiquidCrystal_I2C lcd(0x3F, 16, 2);
int T = 20; // slot milliseconds to read a value from the sensor int sensorPin = A1; int REDLed = 10; int IRLed = 11;
int SpO2; int avBPM;
byte sym[3][8] = { { B00000, B01010, B11111, B11111, B01110, B00100, B00000, B00000 },{ B00000, B00000, B00000, B11000, B00100, B01000, B10000, B11100 },{ B00000, B00100, B01010, B00010, B00100, B00100, B00000, B00100 } };
void setup() { Serial.begin(9600); Serial.flush(); pinMode(sensorPin,INPUT); pinMode(REDLed,OUTPUT); pinMode(IRLed,OUTPUT);
// initialize the LCD // lcd.init(); // lcd.backlight();
// turn off leds digitalWrite(REDLed,LOW); digitalWrite(IRLed,LOW);
// for(int i=0;i<8;i++) lcd.createChar(i, sym[i]); if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3C for 128x32 Serial.println(F("SSD1306 allocation failed")); for(;;); // Don't proceed, loop forever
}}
void loop () { /*display.clearDisplay(); display.setTextSize(1); // Draw 2X-scale text display.setTextColor(SSD1306_WHITE); display.setCursor(20, 10); display.println("Insert Fingure");
display.display(); */ bool finger_status = true;
float readsIR[samp_siz], sumIR,lastIR, reader, start; float readsRED[samp_siz], sumRED,lastRED;
int period, samples; period=0; samples=0; int samplesCounter = 0; float readsIRMM[maxperiod_siz],readsREDMM[maxperiod_siz]; int ptrMM =0; for (int i = 0; i < maxperiod_siz; i++) { readsIRMM[i] = 0;readsREDMM[i]=0;} float IRmax=0; float IRmin=0; float REDmax=0; float REDmin=0; double R=0;
- Assistant