BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Change SimpleTimer for BlynkTimer

Hi everybody, thank you very much for your help.
I’ve been trying for a while to integrate a project of mine with blynk. Done all related examples, and they work fine separately or when I use them in the main sketch. Problem is when I try to put Blynk inside my libraries. Right now, I’m stuck at this error:

Arduino:1.8.7 (Windows 10), Tarjeta:"Arduino Pro or Pro Mini, ATmega328P (3.3V, 8 MHz)"

libraries\DARM_c\DARM_c.cpp.o (symbol from plugin): In function `DARM_c::timerListo()':

(.text+0x0): multiple definition of `_blynkTransport'

sketch\Asistente_Rehabilitacion_Marcha_v1.1.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\DARM_c\DARM_c.cpp.o (symbol from plugin): In function `DARM_c::timerListo()':

(.text+0x0): multiple definition of `Blynk'

sketch\Asistente_Rehabilitacion_Marcha_v1.1.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

Se encontraron múltiples librerías para "DARM_c.h"
Usado: C:\Users\brian\OneDrive\Documentos2\Arduino\libraries\DARM_c
 No usado: C:\Users\brian\OneDrive\Documentos2\Arduino\libraries\DARM_backup
exit status 1
Error compilando para la tarjeta Arduino Pro or Pro Mini.

I think it has something to do with the library SimpleTimer I was using. I used to define in the .h

SimpleTimer_c *Timer;

and in the .cpp

Timer=new SimpleTimer_c;

and it work fine.

I tried changing SimpleTimer for Blynk timer using both pointers and non pointers, and the error on the compiler is always the same. Moreover, the method “timerListo()” that appears in the error log is

void DARM_c::timerListo()
{
	DARM_c::flagTimer=true;
}

where timerListo() is a static method, and flagTimer is a static attriibute. I don’t know why the error says that there’s Blynk stuff defined there.

Can you help me understand? Thank you very much!

Without seeing all the code or knowing what librarys & versions you have installed, your posted snippets are too sporadic to be sure. But BlynkTimer is built into the Blynk library, so no need to add any SimpleTimer library or adjustments to other libraries (except to remove any additions you may have added?), just assign a timer name.

BlynkTimer timer;

http://docs.blynk.cc/#blynk-firmware-blynktimer

Hi Gunner!
They are all custom libraries I made to manage several peripherals (pressure sensor, led, debouncer, buzzer). I have one custom library with the specific functions of this project that includes all the peripheral libraries.
I didn’t post the full code because it is really long. Should I attach it anyway?

Talking about Blynk libraries, I downloaded them from this page.

Well, if all your libraries are custom… then unless you are also linking to them so others can actually download, install and test… It’s up to you.

I have no problem in posting my libraries and the .ino if it’s what you need to help. I tried to upload them as a .rar, but it says I can only upload images. How can I post them?

Anyway, help me understand. How can I get multiple definition errors if I just included Blynk library once?

Either as “formatted” text (IDE code) here in a post

Blynk%20-%20FTFC

Or links to shared files on some form of platform like Dropbox, etc.

Sorry, I for one do not understand enough about what all you are trying to compile to even guess… and if no one else chimes in, then odds are neither do they.

Ok then, here I uploaded my code. https://we.tl/t-7wH1gDYgO5
Hope it will be useful.

Thanks you once again for helping!