TTGO display with pulse sensor

Hello, I am trying to use arduino IDE in order to obtain on a ttgo display esp32 the beat per minute from a simple pulse sensor. I tried to use the example from the PulseSensorPlaygrond to develop the code for the project.

#include <PulseSensorPlayground.h>

#include <TFT_eSPI.h>
#define USE_ARDUINO_INTERRUPTS true
#define TFT_CS 15 
#define TFT_DC 4 
#define TFT_MOSI 23 
#define TFT_SCLK 18 

TFT_eSPI tft = TFT_eSPI(); 
const int PulseWire = 36;       
int Threshold = 550; 
PulseSensorPlayground pulseSensor;  
void setup() {
 tft.begin(); 
 tft.setRotation(1); 
 tft.fillScreen(TFT_BLACK); 
 pulseSensor.analogInput(PulseWire);
 pulseSensor.setThreshold(Threshold);   
}

void loop() {
 if (pulseSensor.sawStartOfBeat()) { 
int myBPM = pulseSensor.getBeatsPerMinute();  
 tft.fillScreen(TFT_BLACK); 
 tft.setCursor(0, 0); 
 tft.setTextColor(TFT_WHITE); 
 tft.setTextSize(2); 
 tft.print("BPM: "); 
 tft.println(myBPM);

 delay(1000); 
}}
Multiple libraries were found for "TFT_eSPI.h"
Compilation error: exit status 1

This is the code, but the error Multiple libraries were found for "TFT_eSPI.h" keeps showing up. I can't delete any library, but this error ocuurs onlu for this code, not for others. Do you have any advice about how can I fix it or maybe another code to use for this?
Thank you.

Why not?

Also, please edit your post and put the code in code tags. Then copy and paste the actual, complete compile error listing after it.

I can't delete those because the one I used in the code I had to download for the ttgo display to work and the other one was installed with arduino ide.

That makes no sense. You can delete a library by just going into the libraries folder and deleting the folder. I can't recall, but I'll bet you can also uninstall it from the library manager...

I don't know what is happening. Do you have any idea where can I find a code for what I need? I'm trying for 3 days to do something correct, but nothing is working.

The problem is, you didn't use more than a few vague words to explain what it is that you need. Please read and follow:

Also, you are not feeding back. You didn't answer post #4, we don't know what you tried, or if you tried anything at all to fix the library problem.

Have you edited the User_Setup_Select.h file?

This file must be edited to match your display before TFT_eSPI will work.

You probably should download a new copy of the TFT_eSPI library, edit the file as mentioned above, and get some example programs running before you proceed with your program.

Don

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.