esp32 non blocking delay. On the ESP8266 and ESP32 the Arduino software is a layer built on software provided by Espressif - FreeRTOS in the ESP32 case. esp32 non blocking delay

 
On the ESP8266 and ESP32 the Arduino software is a layer built on software provided by Espressif - FreeRTOS in the ESP32 caseesp32 non blocking delay  I've removed anything not directly related to my problem, so theres no

Ask Question Asked 7 years, 7 months ago. In the following sketch i can speed up and speed down the ramp with delay ();. This matrix keypad has got 8 pins, 4 for column and 4 for rows. You have your microcontroller connected to a temperature sensor. unsigned long ini= 0 ; void setup() { Serial. I have noticed a weird effect, mabye somebody have noticed too this effect - after 30. Task 2 will run on core 1, receiving data from first task and send it async over TCP. But if any task takes more than the expected time, all other tasks will be delayed and you will notice the delay in execution. – Usman Mehmood. The library provides a simple on/off delay for digital signals or a cycle timer which creates a periodically output. The previous sketch used a blocking delay, i. The resolution of the PWM signal is also configurable. Describe alternatives you've considered. In my FreeRTOS project, I am using another timer, namely TIM1, therefore using HALDelay() doesn’t give me correct behaviour. If you need multiple tasks to occur at the same time, you simply cannot use delay (). I want to add an ultrasonic sensor detector into a robot car which is controlled via android app by user. // Initializing the variable with the time BEFORE the count. Since a non-blocking operation does not put in its best effort in the foreground, it can either return the current result or spawn a background job to complete the task. Here “ Adafruit_NeoPixel. The config portal will stay available after WiFi connection was made. 625°/64 in half-step mode. SNTP library that provides more accurate time for ESP8266/ESP32. @SuGlider. SPI slave device (general purpose SPI controller). setConfigPortalTimeout is not implemented when configPortal is non blocking, because you are in control of it, and can stop it when you want. I edited the example code and removed all I think it is not necessary. 2. time. Note that by default this is a non-blocking method, which means it will return an instance of the WiFiClient class even if there is no client connected. In this way the LED blinks continuously while the sketch. Reversing out this change causes the problem to go away for me. As for making EEPROM writes non-blocking, you could set a (non-blocking). Hardware: Board: Lolin32 Core Installation version: d5fdd71 IDE name: IDF component Flash Frequency: 40Mhz PSRAM enabled: no Upload Speed: 115200 Computer OS: Windows 8. . Therefor, I read a lot, especally about xSemaphoreGiveFromISR which seems to be the most efficiant way to deal with this problem. And it is a non-blocking implementation in a multi-tasking system. How can I rewrite this section, that this is not blocking the main loop but also reading in the wifi-message and the sensor data? Re: non blocking wifi client connection #68870 By andre_teprom - Sun Aug 06, 2017 11:21 amIntroduction. This next sketch shows you how to write a non-blocking delay that allows the code to continue to run while waiting for the delay to expire. 625º = 64 steps in half-step mode. – tavis. I was able to get the current date and time by polling NTP servers and using struct tm and getLocalTime() function. Re: vTaskDelay () vS. Yhe Serial Monitor on PC receives the data and display it. The 28BYJ-48 Stepper Motor has a stride angle of 5. Using the built in Timer class you can define up to 10 software timers that are handled by the OS. The HX711 amplifier is a breakout board that allows you to easily read load cells to measure weight. For a non-async version that handles HTTPS on ESP32, see the follow-on esp32HTTPrequest in this repo. No blocking. The second core is not impacted by the cycles used for connecting WiFi but you will need to consider whether you need. The NoDelay library is used as a easy interface for using the built-in Mills function for keeping track of elapsed time and used for non blocking delays. i think it would. I am using an ESP32-WROOM-32 Development Board (30 pin version) with Platformio (CLion version). 008 -> TFOCFG Out" line the ESP32 stops reading. e. Share. Is there. SPI Master driver is a program that controls ESP32’s General Purpose SPI (GP-SPI) peripheral(s) when it functions as a master. These targets have the following hardware features that make them SMP-capable: Two identical cores are known as CPU0 and CPU1. Problem is, I cannot start them from outside before the time is over. A task runs until it says. The Ticker library allows to very easily setup callback functions to run periodically, without having to worry about the lower level details of setting up a timer (you can check an example on how to setup timer. delay(time in milliseconds); When you call delay(1000) your program stops on that line for 1 second. Code for Shift Register: Switch Debouncer. Beginner in Arduino and ESP-32 needs help. h header file must be included in order to use the delay library function: #include <util/delay. No hardware timers are used. I wrote a modification to take a callback function, and called it in an else clause added to that if statement, and discovered that the blocking delay is not this while loop. As others have noted, this can be done using the same method as used in the standard 'BlinkWithoutDelay' example sketch, and combining that with a state-machine type approach. . setInsecure(); while (status != WL_CONNECTED) { Serial. For delays longer than a few thousand microseconds, you should use. This sounds like an XY problem. The basic principle of non-blocking timing is fundamental different from using delay () You have to understand the difference first and then look into the code. #include #include. Looking back it is clear sure a delay delays = blocking the whole. IotWebConf will start up in AP (access point) mode, and provide a config portal for entering WiFi connection and other user-settings. Symmetric memory (with some small. The first thing you need to do to use the ESP32 Wi-Fi functionalities is to include the WiFi. This means that when timer runs, it will take 51 µs to increment its value at every count. esp32ModbusRTU. print("Attempting to connect to SSID: "); Serial. This guide also includes a comparison of vTaskDelay () function provided by FreeRTOS with. A non-waiting coro issues barrier. 8. As far as I can tell, that only fixes blocking to the led, but the core issue remains and will likely case other unforseen blocks. I'm also doing some looping with delays for reading a sensor data and switch on/off relay cooling. . The library provides a simple on/off delay for digital signals or a cycle timer which creates a periodically output. run () Task handles in-coming. I have a task that waits for a semaphore to run. 2 Pins 2. The time module provides the following time, date, and delay-related functions. This hardware-based PWM library, a wrapper and enhancement around ESP32-core ledc code, enables you to use Hardware-PWM on ESP32, ESP32_S2, ESP32_S3 and ESP32_C3 boards to create and output PWM. So I adapted your demo-code to this and got a continious reset each time the ESP8266 just connected to my router. Is there a way to make our delays non-blocking? An example of how this can go wrong Let’s create an imaginary device to highlight this issue. As you can see in the datasheet (below image) there are some lines also. pdFALSE if xTicksToWait expired without the semaphore becoming available. All functions are non-blocking (without using delay () function) Easy to use with multiple LEDs. esp_timer set of APIs provides one-shot and periodic timers, microsecond time resolution, and 64-bit range. Socket operations will return EWOULDBLOCK if they would block need to block (e. Hi I would like to use esp_wifi_scan_start() in non-blocking mode; is there an API or register that allows to check if the scan has completed?. Delay a task for a given number of ticks. Then we can likely propose a good way of solving your problem. The "delay" node does two things: (1) It allows you to delay a message by an arbitrary amount of time and (2) to limit the rate of messages that are passing through it. Consult the datasheet of your microcontroller if you’re using a non-AVR MCU. Most of the time it's as low as 50us. 1. Non blocking temperature sensor library for Arduino. On the other hand , uint8_t is unsigned. PinFlasher, a non-blocking flashing of an output pin. THE TICK is a new Netflix show. h> Calling the Function. You initiate an erase of the EEPROM address pointed to by EEARH/EEARL, by setting EEPM1 to 1, EEPM0 to 0 and setting EEPE to 1 to start the erase operation. A common way for a sketch to stall is the use of a delay. These PWM waves are produced by hardware timers, which. Yes, delay (8000); in your void timeDelay () {. There is no particular limitation on this although if you have really long delays and do NOT have to worry about using timers, I would recommend interupt timers and using ISRs. The previous sketch used a blocking delay, i. The function is called and passed the desired time delay in milliseconds. ESP32 runs FreeRTOS with preemptive multi-threading. Important Notes about using ISR. unsigned long ini= 0 ; void setup() { Serial. An ESP32 timer group should be identified using timer_group_t. 4 posts • Page 1 of 1. An interrupt service routine should be as light as possible so that it can service an interrupt quickly. I'm developing high frequency DAQ based on ESP32 and freeRTOS. All reactions. To address this, the following code implements a non-blocking approach using the ezLED library. This is useful to send comamand from your PC to ESP32. In the following sketch i can speed up and speed down the ramp with delay ();. Hi, i am using the OneWire Library. On the other hand, when I use an Arduino Nano instead of the ESP32, it reads distorted and the characters become. SNTP library that provides more accurate time for ESP8266/ESP32. Once freeRTOS is loaded, memory allocations need to be thread safe. However, the output shaft is driven via a 64:1 gear ratio. Beginner in Arduino and ESP-32 needs help. The objective of this post is to give an introduction to FreeRTOS queues, using the ESP32 and the Arduino core. Update 15th Dec 2020 – Revised to use SafeString readUntilToken and BufferedOutput for non-blocking Serial I/O, loopTimer now displays its print time as prt: Update 27th Sept 2020 – Added note about using multiple thermocouples/SPI devices Update. You'll see blynkTimer Software is blocked while system is connecting to WiFi / Internet / Blynk, as well as by blocking task in loop(), using delay() function as an example. At least one coro must wait on the barrier. compare if currentMillis-pressMillis > 8000, if then shut the led. This simple library for Arduino implements a machine state for reading the Maxim Integrated DS18B20 temperature sensor without blocking the main loop() of the sketch. 2. ESP32 SoC has two processor cores (three in fact, if you also count the ULP core). 2. There will be 2 task, first task will run on core 0, communicating with sensors to collect data at 4000SPS, using SPI bus. Every: Non-blocking replacements for delay(). If it has, it toggles the LED on or off and makes note of the new time. 3. ESP32 ADC Read analogRead() for Analog input pins in Arduino IDE. The two ESP32 timer groups, with two timers in each, provide the total of four individual timers for use. Netconn API lwIP supports two lower-level APIs as well as the BSD Sockets API: the Netconn API and the Raw API. begin(9600); // This delay gives the chance to wait for a Serial Monitor without blocking if none is found delay(1500); myservo. A simple while (1) like this : Code: Select all void led_fast() { ESP_LOGI (TAG, "LED FAST INITIATED" ); while ( 1) { gpio_set_level (LED, 0 ); vTaskDelay ( 500. Asynchronous HTTP for ESP8266 and ESP32. Hi all, I am using ESP32 to do a project by using delay() function. UDP socket non-blocking. Configuration of GDB Hardware Debugging - Debugger tab. Now enter your instance name and select ‘Cute Cat’ in plan option. . In this post we are going to learn how to get started with the Ticker library, using the ESP32 and the Arduino core. micros() and overflow. 2. Timer Initialization¶. ype Function AnalogI do not use millis() and delay() with the ESP32 and I write all my ESP32 code using freeRTOS, which would make a significant difference in operations. Fortunately, the same solution applies to the ESP32 also (i. delay () will stop every other code from execution. micros() and. As long as the delay is "delaying" nothing else of the code can be executed. I avoid the command delay() even in the smallest democodes and use a non-blocking-delay based on millis(). Best power transistor for a high PWM output from ESP32. To get it working output is given to either column or row and output is detected. To generate a delay like this, both functions must be blocking. Another benefit millis()is that it doesn't prevent us from running code while "waiting". knightridar:That is the firmware. setblocking(True) is equivalent to sock. Currently, the largest value that will produce an accurate delay is 16383; larger values can produce an extremely short delay. How can i achive this? Should i use millis () for track the time. I am having one task which should check if data is available, however, I noticed that its blocking all other tasks because its not yielding on recvfrom () function. The char datatype is a signed type, meaning that it encodes numbers from -128 to 127. ESP32 Pin Layout (QFN 5*5, Top View) EspressifSystems 13 SubmitDocumentationFeedback ESP32SeriesDatasheetv4. Get(); // Get the current delay. !) BTW I'd be happy to submit a PR if there's an agreement on what it might. Now we have to calculate the value to be filled in Timer register to generate 1 sec delay. In general: no, gethostbyname *cannot* be non-blocking as it uses DNS to resolve a hostname, which involves sending UDP packets to a DNS server and waiting for a reply. Find this and other ESP32 tutorials on ESP32GetStarted. ESP targets such as ESP32, ESP32-S3, and ESP32-P4 are dual-core SMP SoCs. Find this and other ESP32 tutorials on. Web Control Panel – Non Blocking Web Server Using Asyncio and Dual Cores – Raspberry Pi Pico, ESP32, Arduino In our previous tutorial we developed a MicroPython Web server which was able to receive an HTTP request, decode it, handle any actions required, and prepare an HTTP response which could then be sent back to the. ino at master · prampec/IotWebConfIt looks like rosserial expects non-blocking read/write. one that completely stopped the code from doing any thing else while the delay was waiting to expire. 0. This is one of the most common peripherals used to connect sensors, EEPROMs, RTC, ADC, DAC, displays, OLED, and many other devices and microcontrollers. Hello, My question is about implementing the functionality of HALDelay(), which is implemented based on the SysTick timer tick count. 5 seconds; Power off the LED; Use delay(500) to make the program sleep again for 0. If you like ESP32, you may also like: Send Email from ESP32 via SMTP Server (Arduino IDE) ESP32 with WiFiMulti: Connect to the Strongest Wi-Fi Network. To change it unblocking you must in the loop, in each round: if btn pressed store the pressMillis, lit the led. Your use of blink without delay is again blocking through the for (; loop non-blocking programming means there is only one loop. As the website says: This is a “smart” asynchronous delay - other code will still run in the background while the delay is happening. One way would be to set up a FreeRTOS message queue which your while loop can scan. // This code is executed each "delay_in_microseconds". 1 Sync Time with NTP Service from a server and set the local clock in the ESP32 (this is well documented and working) 2 Read current usecond till next sec, register a Timer#1 to Trigger when the second arrives. I have pinned one task to each core with infinite loops. This is useful so that your code doesn't block the Device from interfacing with the Blynk Server. me-no-dev added the Type: Feature request Feature request for Arduino ESP32 label Feb 23, 2017 me-no-dev added a commit that referenced this issue Mar 3, 2017 Add Arduino SAM compatible analogReadResolution and Non-Blocking ADC api. The issue is that to get the distance from the ultrasonic, you need to perform small delays over the code. Find this and other ESP32 tutorials on. A blocking function is delay(). ; Measuring distance between 3 meters and 7 meters. Connect the output pins of the driver with the respective motor pins. The pseudo code shown below gives a non blocking. I'm using millis() in order to set one counter to 0. In full-step mode: 64/2 = 32 steps to complete one rotation. . ESP32-WROOM-32 PWD with millis. delay() would pause the entire code until the time is reached. Otherwise delay might be even few days (depends on higher priority tasks. The FreeRTOS kernel is ported to all architectures (i. The timer provides basic functionality to implement different ways of timing in a sketch. vTaskDelay is a non-blocking delay. 2. However, the time I receive back from the NTP server doing so is in seconds and I would like to have the time in milliseconds or microseconds precision. ESP32, if one is to look at the code for delay(), as I was shown, one will see that delay() on an ESP32 invokes vTaskDelay(), to run vTaskDelay(), a non-blocking delay, freeRTOS will be loaded. avr, esp8266, esp32. Connect the STEP pin and the DIR pin with any appropriate GPIO pin of ESP32 board. This seems to be working but the tcp send call frequently stalls for as much as 2ms when I call it. Delay a task until a specified time. Arduino - delay () function. You need an micro USB cable between PC and. Multitasking on the ESP32 is non-preemptive. ). This is possible by using ESPAsyncUDP library. The non-blocking interface call does not block the current process, while the blocking interface does. Once freeRTOS is loaded, memory allocations need to be thread safe. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Therefor, I read a lot, especally about xSemaphoreGiveFromISR which seems to be the most efficiant way to deal with this problem. Every: Non-blocking replacements for delay(). Hardware Arduino UNO or any other board supported by the Arduino IDE All the code developed here can be tested with just an Arduino UNO. The elapsed time then is very unaccurateOne way would be to set up a FreeRTOS message queue which your while loop can scan. That coro will pause until all non-waiting coros have passed the barrier, and all waiting coros have reached it. Then, each time through. ducalex commented Jul 11, 2019 •. Subset of HTTP. Let's say portTICK_PERIOD_MS. The time setting can be done manually through a network protocol or a battery backup. The actual time that the task remains blocked depends on the tick rate. Find this and other ESP32 tutorials on esp32io. SafeStringStream, a stream to provide test inputs for repeated testing of I/O sketches. In FreeRTOS, there are a few ways to delay the execution of a function: vTaskDelay() allows us block the currently running task for a set amount of time (given in ticks). FIONBIO is an alternative way to set/clear non-blocking I/O status for a socket, equivalent to fcntl(fd, F_SETFL, O_NONBLOCK,. delay() . The previous sketch used a blocking delay, i. compare if currentMillis-pressMillis > 8000, if then shut the led. ESP32-WROOM-32 PWD with millis. function codes implemented:Returns: pdTRUE if the semaphore was obtained. 17. In regular arduino code, the delay function. Each of those can be assigned to any PWM-capable pin. 25 = 4C4B H. This non-being-blocked important feature is absolutely necessary for mission-critical tasks. h> Servo myservo; void setup() { // Initialize serial and wait for port to open: Serial. print to log statements This ends up introducing delay's in the system. Select the correct COM port. time. trigger() to indicate that is has passed the critical point. Recently, I had been using the Adafruit Feather ESP32 V2 with ToF sensors from Pololu, and surprisingly I got into the same problem that I encountered when I was using these sensors with the MKR ZERO back in June 2022 - see this post This time I was using the Classic SerialBT that comes with this ESP32 board. To fade an LED on and off with an Arduino Uno (or other basic Arduino boards), you use the analogWrite method. Make sure that the speed is the same on both board. When the server is requested by a client, like a computer connected to the same WiFi connection, it returns an HTML page. The ezLED library. 2 Overview Overview Name No. This function is used to setup LEDC pin with given frequency and resolution. Looking back it is clear sure a delay delays = blocking the whole processor from doing anything else than delaying. These purely hardware-based PWM channels can generate very high PWM frequencies,. Hi, i am using the OneWire Library. ESP32: sampling a 1 kHz square wave (10%-90% duty cycle) with analogRead() 0. The ESP32-S2 has two groups of two hardware timers so if I need to have multiple timers in use, then knowing which timer is being used would be helpful. delay() . IotWebConf will start up in AP (access point) mode, and provide a config portal for entering WiFi connection and other user-settings. the calling task is. I've removed anything not directly related to my problem, so theres no. A non blocking delay is a type of delay that allows other code to operate even though there is a delay operation elsewhere. I would like to read the characters received through the serial USB connection of an ESP32-Pico-Kit board inside my main. Follow. The lwIP Raw API is designed for single-threaded devices and is not supported in ESP-IDF. Can you give us any guidance on the response time needed for the WiFi/Server code running in an ESP32 VS other user code?? THANKS! Any comments or suggestions or critique welcome! NoDelay. However, we have to pay attentions when using this function:ESP32 with A4988 and stepper motor connection diagram. The "delay" node does two things: (1) It allows you to delay a message by an arbitrary amount of time and (2) to limit the rate of messages that are passing through it. Code: Select all. This could change in future Arduino releases. The exact hardware timer implementation used depends on the target, where LAC. Although i power the sensor in non-parasitic mode, there are still delays necessary. I found out it was caused by the command delay(). micros() and overflow. On ESP32-C6, the hardware additionally allows to perform up to 16 consecutive linear fades without CPU intervention. loopTimer, ( loopTimerClass) to track of the maximum and average run times for the loop () millisDelay, a non-blocking delay replacement, with single-shot, repeating, restart and stop facilities. This sketch demonstrates how to blink an LED without using. 1. Every: Non-blocking replacements for delay(). Maintainer: Michael Contreras. I edited the example code and removed all I. Which makes 'loopDelay' a stupid name 'SerialInterval' is more appropriate. Use delay(500) to make the program sleep for 500 milliseconds, or 0. i do not need very fast measuring intervals (e. How I can solve this problem? Best, nopnop2002. one that completely stopped the code from doing anything else while the delay was waiting to expire. {"payload":{"allShortcutsEnabled":false,"fileTree":{"WiFi_nonBlocking":{"items":[{"name":"WiFi_nonBlocking. A task switch is normally considered a form of “blocking”, isn’t it? Some other task may run, but YOUR task has. 10. c. (This is what my understanding is, I might be incorrect as well. sleep (seconds): This blocking method provides a delay in seconds. Light Sleep Mode. At that point all waiting coros will resume. To set up an account on Cloud MQTT navigate to its official website ( and sign up using your email. You should use it if you are using arduino, and also you should post in the arduino forum. PWM on ESP32 . } var. * (See previous examples for more details!) * * Software setup for this example:Light Sleep Mode. You'll see blynkTimer Software is blocked while system is connecting to WiFi / Internet / Blynk, as well as by blocking task in loop(), using delay() function as an example. It's not advisable to make the tick period any shorter than 1ms. Even while the blocking code is executing, the higher priority Blynk. After searching on. ESP32 had a total of 4 hardware timers (Timer0, Timer1, Timer2, Timer3) which are all 64 bit based on 16-bit pre-scalers. Which can be used to create a time base for various events in your applications (like LED blinking or whatever). You'll see blynkTimer Software is blocked while system is connecting to WiFi / Internet / Blynk, as well as by blocking task in loop(), using delay() function as an example. Show 2 more comments. */ #include "thingProperties. There is a solution comes with async TCP library for Arduino based ESP8266 users, where you can adapt your code base on it, and here is the sake of flexibility. However, the adc read function is a non-blocking routine. IotWebConf. The library does not do any dynamic memory allocation. Set(new_delay_micros); // Set new delay interval and returns the old one. As the website says: This is a “smart” asynchronous delay - other code will still run in the background while the delay is happening. In fact, the number of cores doesn't really matter much as long as you're not running out of CPU cycles or violating the real-time deadlines of your animations. The Wi-Fi driver can be considered a black box that knows nothing about high-layer code, such as the TCP/IP stack, application task, and event task. This xEventGroupWaitBits (eg, evtDoTheBME280Thing, pdTRUE, pdTRUE, portMAX_DELAY ); is a task trigger. Examples of non-blocking operations include non-blocking send (synchronous) and CLFLUSHOPT. Channel state information (CSI) leverages carrier signal strength,. It uses a non-blocking approach and can control LEDs in simple ( on / off) and complex ( blinking , breathing and more) ways in a time-driven manner. is there a non-blocking type of library for this sensor out there (which works like the "blink without delay" - example)? Blocking refers to whether something runs asynchronously or not. THE TICK is a new Netflix show. ESP8266/ESP32 non-blocking WiFi/AP web configuration Arduino library - IotWebConf/IotWebConf14GroupChain. The main reason to use non-blocking delays is because delay() blocks code execution until it returns, which means nothing else can run while delay() is delaying. Open Arduino IDE, then go to the tab Sketch and click on the option Include Library-> Manage Libraries. Modbus Client aka Master for ESP32. stdin. Please take note that the code mentioned above utilizes the delay() function for simplicity. Hello together, I’m using the Pololu - VNH5019 Motor Driver Carrier to control a 12v motor with an ESP32. Ideally, task 2 should send data while task 1 collecting latest one. Definition. JLed got some coverage on Hackaday and someone did a video tutorial for JLed - Thanks! JLed in action. ino" with your Arduino IDE. Getting Date and Time from NTP Server. Supports: GET and POST; Request and response. I tend to go for a non-blocking, delay()-less, millis()-based state machine approach right from the start, in all but the most trivial cases. Yes, delay (8000); in your void timeDelay () {. I am trying to create my own delay function but my sketch keeps crashing. When the server is requested by a client, like a computer connected to the same WiFi connection, it returns an HTML page. If you need better resolution, you can use micros(). When you do delay (1000) your Arduino stops on that line for 1 second. 3 In the callback function of the Timer#1 start Timer #2 with the interval of 1 sec. Term. I'm still working on getting an ESP32 to RE-sync with an NTP-server when coming back from deepsleep. The number of concurrent tasks is a compile time constant, meaning there is a limit to the number of concurrent tasks. The jmp(x_dec, "delay_high") will keep looping to the delay_high label as long as the register X is non-zero, and will also post-decrement X. Then you can reset it whenever you need. See moreOn an ESP32 delay() is transformed into vTaskDelay() which is a non-blocking delay. Your Chrono and Webserver tasks simply won't work the way you've written them. }. Basically, all that I had to do was add 2 global variables (user_tx_timeout_ms and user_txBufferSize) and changeAn embedded C++ library to control LEDs. A fade can be operated in blocking or non-blocking mode, please check ledc_fade_mode_t for the difference between the two available fade modes. Using delay on a ESP32 whiles using freeRTOS is a waste of CPU time. To change it unblocking you must in the loop, in each round: if btn pressed store the pressMillis, lit the led. BLE’s primary application is short distance transmission of small amounts of data (low bandwidth). It covers non-blocking delays, non-blocking serial output, non-blocking user input, removing delays from third party libraries, and loop timers, so you can see. Join our thriving online community today!I've searched for the past 3 days on the internet for connecting to a WiFi network without blocking the code and after the connection is established, to connect to Firebase (also in a non-blocking fashion), but I can't make it work. Um. In this video, we will learn to create a non-blocking delays in MicroPython which is very similar to millis funtion of Arduino. Every example I see requires the use of millis () but I need an accurate, 100uSec, non-blocking ISR driven. The detail instruction, code, wiring diagram, video tutorial, line-by-line code explanation are provided to help you quickly get started with.