So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By HansSolo
#90687 Hello,

I want to use the SoftTimer library from Prampec on a NodeMCU.
I can compile and create task that uses pins D0..D4 but when I try to use pins D5-D8 nothing append.

I compile under Arduino IDE version 1.8.13
I downloaded the library from https://github.com/prampec/arduino-softtimer
and I'm using the library example: SoftTimer2BlinkTask1.ino; modified to feed the ESP's watchdog.
The circuit: only the NodeMCU powered thru USB and 1 (Led & Resistor) to GND

Program:

#include <SoftTimer.h>
#include <BlinkTask.h>


#define LED_PIN 2
void feedWatchdog(Task* me);

// -- On for 1000ms, off for the same time, and repeat it forever.
BlinkTask hartbeat(LED_PIN, 500);
Task watchdogFeederTask(1000, feedWatchdog);

void setup() {
hartbeat.start();
SoftTimer.add(&watchdogFeederTask);
}

void feedWatchdog(Task* me) {
ESP.wdtFeed();
}

I can blink the led using #define LED_PIN (16,5,4,0,2) but the led doesn't blink using pins (14,12,13,15)

I also tested the same library (SoftTimer ) on an Arduino UNO and it works for all the pins.

Is there something special about the ESP pins that I don't know?

Thanks
User avatar
By QuickFix
#90699 Except for D8 (GPIO15, which has to be pulled LOW at boot) there's nothing special about D5-D8.
maybe the SoftTimer library is not ESP compatible (not all Arduino libraries are 1:1 compatible with the ESP and there are often special branches for the ESP)?
User avatar
By HansSolo
#90783 I contacted the author and he replied that it should work.
I decided to let go even if this library seemed to me as very interesting. Right now I don't have the time to play with it but maybe one day...

thank you both of you