esp8266 delay microseconds. Since I have a USB tester I can check that if the loop method is empty, the boards consume about 70mA-80mA but during delay(ms) they consume about 20mA-30mA. esp8266 delay microseconds

 
 Since I have a USB tester I can check that if the loop method is empty, the boards consume about 70mA-80mA but during delay(ms) they consume about 20mA-30mAesp8266 delay microseconds  This allows us great accuracy in microseconds but not so nice for processor and interrupts

5 seconds; And go back to step 1, because the loop() function keeps being executed again and again. The module features a simple two-wire I2C interface. Parameters. Among the functions available to it, the following can be highlighted: Scheduled execution every x milliseconds and even microseconds. com is closed. La función delay() pausa la ejecución de tus programas, no deberías utilizarla pues bloquea tu tarjeta, en este vídeo te. Most of the time, the measurement shows 14us (1170 cpu cycles at 80mhz). So I changed delayMicroseconds(100) to delayMicroseconds(1000) which should be the same as delay(1) which didnt crash. Timestamp of the nearest timer event, in microseconds. delay(0) really causes no time delay, it returns within microseconds on most platforms. 🚀 Evitar usar delay(), usa Ticker. filo_gr Posts: 109 Joined: Wed Jul 28, 2021 12:25 pm Location: Italy [SOLVED] My function for microseconds delay doesn't work properly. The Real-Time Operating System (RTOS) and Wi-Fi stack allow about 80% of the processing power to be available for user application programming and development. I need to get rid off delays cuz the readings can't be late. int outPin = 8; // digital pin 8 void setup() { pinMode(outPin, OUTPUT); // sets the digital pin as output } void loop() { digitalWrite(outPin, HIGH); // sets the pin on delayMicroseconds(50); // pauses for 50 microseconds digitalWrite(outPin, LOW); // sets the pin off delayMicroseconds(50); // pauses for 50 microseconds } Reference ¶ Interrupts ¶ Interrupts can be used on the ESP8266, but they must be used with care and have several limitations: Interrupt callback functions must be in IRAM, because the flash may be in the middle of other operations when they occur. Just like delay () has a microsecond-version called delayMicroseconds (), millis () has micros (). I’ve updated my delay library to support milliseconds and microseconds delays. Currently, the largest value that will produce an accurate delay is 16383. Return. #include <Arduino. Example run (the last value is delay in usec, which should be 14, but it's more): I (4895) main: 7:2304(28) I (7472) main: 35:2221(27) Hi all, I'm solving issue with light sleep on ESP8266 (ESP-01). AlfonsMittelmeyer commented on Apr 10, 2018 •edited. Dimming Neopixels, Delays<Microseconds. kolban Posts: 1683 Joined: Mon Nov 16, 2015 4:43 pm. Hardware: Board: ESP32 DEVKITV1 Core Installation/update date: 25/apr/2018 IDE name: Arduino IDE/IDF component Flash Frequency: 80Mhz Upload Speed: 115200 Description: micros () returns strange values when using arduino-esp32 as component. All the call does is schedule something to take place in the future. That is essential if you use this function to debounce or throttle GPIO input. Now select your board in the Tools > Board menu (in our case, it’s the NodeMCU 1. Hence, the max deep sleep interval appears to be ~71. Then post here. Look for ESP8266 by ESP8266 Community. hw_timer_t * timerBegin(uint32_t frequency); frequency select timer frequency in Hz. Top. I am trying the run stepper motor with the tmc2208 driver and ı want to delay in microseconds like 5uS or 10 uS. 3. And for this reason, the prescaler value is 72. Part 1 It is not usually long before new Arduino users discover that although the delay() function is easy to use it has side effects, the main one of which is that its stops all activity on the Arduino until the delay is finished (not quite true, I know, but that is usually how the problem presents itself). light sleep: the necessary steps to enter timed sleep are a bit fickle, so read this closely (see esp8266/Arduino#7055 for more details): timer-based light sleep can be between ~10. Copy the sketch below to your Arduino IDE. core_esp8266_main. show() flickers the first led on my strip (16 leds total). I ran your code and the results matched mine. Download the latest ticker package as a zip file. The most important feature is they're ISR-based PWM channels. Learn how to install the ESP8266 board add-on in Arduino IDE in less than 1 minute. \hardware\tools\esp8266\sdk\include directory. Is that correct ?Timers are useful when code needs to be executed at a specific interval, such as blinking an LED. Unzip the package from point 1. Go to Tools and select “Generic ESP8266 Module”. Then post here. If you’re powering the sensor from a 3. delay(ms) pauses the sketch for a given number of milliseconds and allows WiFi and TCP/IP tasks to run. first it was green (full brightness even when set to a 64) after a few sketch flashes it changed to pink (no clue if the color is some indication for something) It also does not look to mater what I write to the strip, random colors, a flame pattern, or just no. Set the Presaclar bits in OPTION_REG as per the delay. red. Returns the number of microseconds since the Arduino board began running the current program. 5 rather than dutyCycle / 100 = 0. sleep_ms (500) # sleep for 500 milliseconds time. timer speed (Hz) = Timer clock speed (Mhz) / prescaler. Milliseconds based delay is done using systick timer which makes interrupts every 1ms generated by HAL library. According to the ESP8266 SDK, you can only sleep for 4,294,967,295 µs which is. ESP8266 D5 pin to A4988 Step pin. osapi. The solution (easy way) is to make a new connection every time you want to send data. Next you have to include dwt_stm32_delay. ESP8266 D6 pin to A4988 Dir pin. void ntDelay (byte t) { // non timer delay in seconds for (byte i = 0; i. It may be used either to read voltage at ADC pin, or to read. h is in the. Other devices may have an RTC (realtime clock) providing the current Unix timestamp which does not reset. What is the resolution of the micros () function on the Arduino Nano? a) 2 Microseconds. Thanks. Sleep itself working almost correctly, but there is one thing which is wery confusing. ESP8266 Report Bugs Showcase;The RED section in the above schematic (the Schottky-Diode) is optional (ie. Instead of using incremental calls to delayMicroseconds(), accuracy is now dictated by the internal micros() clock. The argument is an unsigned long which on a 16-bit Arduino is a 32-bit unsigned integer type, having a maximum value of 4,294,967,295. Get time in microseconds since boot. 3cm (0. Regards, Ritesh Prajapati. When ı create a task using xTaskCreate() function and adding some delay in the task function. esp_timer set of APIs provides one-shot and periodic timers, microsecond time resolution, and 64-bit range. delay (5000) - means delay of 5 sec. See the corresponding section of the tutorial: Getting started with MicroPython on the ESP8266. As ESP-01 has only 2 GPIOs, only 2 loads can be controlled, here my necessity is to control one AC load in timer delay off mode. 0-beta2\libraries\Ticker. Some Arduino libraries require it even for sending. : read a DHT. interval() – Changes a registered timer’s expiry interval. Currently, the largest value that will produce an accurate delay is 16383. ESP32 Timers. Your new topic does not fit any of the above??? Check first. Blocking functions prevent a program from doing anything else until that particular task has completed. 5-947-g39819f0). When it wakes up, it begins running the user. There was a lot of discussion about this, and Jeff agreed in some cases that it was a good way of asking. Re: vTaskDelay () vS. Use sleep_us() for more precise delays. millis() and micros() return the number of milliseconds and microseconds elapsed after reset, respectively. {"payload":{"allShortcutsEnabled":false,"fileTree":{"tasmota":{"items":[{"name":"berry","path":"tasmota/berry","contentType":"directory"},{"name":"displaydesc","path. I don't see udp. sleep_ms ( 500 ) # sleep for 500 milliseconds time . I usually use a 470 Ohm resistor. DWT unit is for F4 and F7 only, F0. utime. com wiki) without having to use the Arduino IDE for uploading the. It’s argument is a full 8-tuple which expresses a time. ESP8266 & BME280 Based Mini Weather Station. 1) Blink without Delay. delayMicroseconds(us) pauses for a given number of microseconds. g. Then post here. This instructable is based on ESP8266 version ESP-01 which is programmed as wifi timer for switching AC loads. Returns. My ESP8266 is also connected with a stable WiFi and I have also included the required. Before proceeding further have good info about ESP8266 and its flashing and uploading. Neopixels have great possibilties. Running a number of times or forever. TX: UART serial communication transmit pin. pdf (146 KB) With ticker delayMicroseconds AM2321 ok. h> #include <ctime> using namespace ace_time;. I also used portTICK_RATE_MS but the speed didnt change . LAC timer is used for ESP32. For that purpose, lib has been changes. My ESP8266 is also connected with a stable WiFi and I have also included the required libraries. Please help me! Thanks all so much. Pauses the program for the amount of time (in microseconds) specified as parameter. Don't do delays inside an ISR; If you must do them, you can time then with micros() but not millis(). Join the GND pin of the ultrasonic sensor with the GND pin of the nodemcu. For 1 microsecond delay, I got a count of 213. sleep_us (us) ¶ Delay for given number of microseconds, should be positive or 0. delay(ms) pauses the sketch for a given number of milliseconds and allows WiFi and TCP/IP tasks to run. This tutorial covers how to develop an ESP8266 MQTT client to publish and subscribe to MQTT topics using Pubsubclient. 2) Blink multiple LED with different interval. {"payload":{"allShortcutsEnabled":false,"fileTree":{"components/esp8266/include":{"items":[{"name":"driver","path":"components/esp8266/include/driver","contentType. In light of our recent power-consumption related posts 1 & 2 it seemed logical to ask ourselves about max deep sleep for ESP8266. 3V pin, in some cases powering the DHT with 5V solves the problem. Do note that 64 x 64 -> 64 bit multiply is typically 4x slower than the 32 x 32 -> 64 bit multiply that was in the original question. For the Arduino and ESP8266 boards we use the A0 pin and for the ESP32 we define pin 4 as analog input. So within a few microseconds you have scheduled 10 things to take place at about 2 seconds in the future. g. 3V Vcc (Vcc cannot exceed 3. If you want to get the logic level of e. This could change in future Arduino releases. Works like a "thread", where a secondary function will run when necessary. Both wemos d1 mini and NodeMCU devices show the same issue. The code will be compiled and uploaded to the ESP8266 wifi module. A tick is what you configure it to be. Since these are milliseconds, the maximum delay () would be 4,294,967. The timing of these timers depends upon the clock and varies from one board to the other. Viewed 651 times. digitalWrite (pin_no4, LOW); // triac Off. The value of the resistor in series with the LED may be of a different value than 200 ohm; the LED will lit up also with values up to 1K ohm. Upload the code to your ESP32/ESP8266 board. Moderator: igrr 7 posts;The function timerBegin (uint8_t id, uint16_t prescaler, bool countUp) allows to configure the timer : The ESP32 has 4 independent timers, selected by an id between 0 and 3. That means that it ticks at C times per second or, each clock tick is 1/C seconds. tmr. Interrupts can happen during a delay () but delay () (millis ()) will not increment during an interrupt as interrupts are disabled in an ISR (Interrupt Service Routine). To enable sleep there must be delay after wifi_fpm_do_sleep which must be at least +1 longer than setted sleep duration. sleep (1) # sleep for 1 second time. Code: Select all ets Jan 8 2013,rst cause:2, boot mode:(3,0) load 0x40100000, len 31488, room 16 tail 0 chksum 0xb1 load 0x3ffe8000, len 924, room 8 tail 4 chksum 0x87 load 0x3ffe83a0, len 25872, room 4 tail 12 chksum 0x9e csum 0x9e don't use rtc mem data rl rl bl br| bll lb n nn l | l l l l` n b b bl b , >>> MicroPython v1. For example, 1us = 1 / 1000000 of a second = 1MHZ clock rate. Upload code to ESP8266-01. Hello, I've found ticker. As long as you don't need interrupts from the involved timer, there are no complications using interrupts and delay() . If you replace the while statement with: while (digitalRead (5)==HIGH) delay (1); Then it works as you would have expected. The downside is that you would need to include that 8 bit quantity in all time calculations so you would need to make your own "greater. By dirkx - Thu Apr 09, 2015 4:32 pm. 000 and 0xFFFFFFE = 2^28-1 = 268435454 microseconds (~4 1/2 minutes) for light sleep to be entered successfully: the OS timers need to be cleared/disconnected. so they do not have round trip delay into account. I haven't tested with more lamps yet. As mentioned in the comments, waking from deep sleep on the ESP8266 is a hardware reset so. delay () is a blocking function. pin: the number of the pin that the servo is attached to. For a STM32 MCUs running at "low speeds" this is a non-negligible overhead (moreover you. First of all, set the clock source as internal clock. right at the beginning of the user_init function in core_esp8266_main. Hi all, I'm solving issue with light sleep on ESP8266 (ESP-01). I dont get any delay even if I add some different delays. ESP8266 NodeMCU has an onboard LED that is connected with the GPIO2 pin. Timing and delays millis()and micros()return the number of milliseconds and microseconds elapsed after reset, respectively. 4 supports ESP8266. 9 and right now I am facing this error now. It is a two leg device the longer leg is positive. Unsigned longs on the arduino can reach from 0 to 4,294,967,295. So that points at the ESP32's RTOS (namely FreeRTOS) and for some reason it introduces. romkey. So, you can easily make this home automation. Because a delay inside an interrupt causes that interrupt and other (lower priority) interrupts not to execute anymore until the delay is over. Unzip the package from point 1. time. Not a great analogy to a variable overflow in C/C++, but you get the idea… We mentioned one caveat with these functions, and that is that millis() and micros() overflow after around 50 days and 70 minutes, respectively. ESP8266 D6 pin to A4988 Dir pin. 1 Answer. Code. GPIO get input level. I vaguely. sleep ( 1 ) # sleep for 1 second time . 4) Control Blinking LED with debounce Button. delayMicrosecond (μs) This function is similar to the delay function except for delayMicroseconds () holds the program for microseconds and the delay () function. Ticker is called every 500ms, but only lights the LED on every 20th call. In pseudocode it will look like this:By default, the baud rate of esp8266 is 115200. The actual delay may be longer than this value depending. 2. Handling delays of some microseconds using interrupts would flood the MCU, and it's not that good for precise delays. In addition, this particular module comes with ultrasonic transmitter and receiver modules. It is anyway the good way to handle your delay and let other services work flawlessly. cpp did the trick! Steps: 1) Add #define USE_US_TIMER at the. So, I note that the vTaskDelay in the arduino does a delay of 15ms because of the Watchdog timer, this is the piece of code that says it. Dec 4, 2017 at 21:29. Hi, I'm following the sntp example to get the unix timestamp but. GPIO 16 must be connected to reset (RST) pin so the ESP8266 is able to wake up. ESP32 had a total of 4 hardware timers (Timer0, Timer1, Timer2, Timer3) which are all 64 bit based on 16-bit pre-scalers. VCC: Connection to 3. From the arduino reference page for delay the parameter for delay is an unsigned long. The HC-SR04 ultrasonic sensor uses sonar to determine the distance to an object. Switch to “Standby” mode, when you are not executing any task, which will allow us to save energy. 3600000 microseconds = 3. Timing and delays¶. Top 1 post • Page 1 of 1The Timers — MicroPython latest documentation. first of all, many thanks for this great library and toolset for ArduinoIDE to work with ESP8266. Connect the ultrasonic sensor to the Arduino system by attaching wires from the Arduino pins to holes on the breadboard which attach to the corresponding pins on the ultrasonic sensor. The library use no interupts of the. 3V!) RESET: Reset pin (pull down to reset) CH_PD: Chip enable and power down pin. It is commonly used in obstacle avoiding robots and automation projects. fn_read_pin: read rx pin. COROUTINE_DELAY_SECONDS(seconds): yields back execution for seconds. Sent 122389760, Got response 0, Round-trip delay 116644 microseconds Now sending Sent 123508764, Got response 0, Round-trip delay 18640 microseconds Now sending Sent 124529728, Got response 0, Round-trip delay 18308 microseconds Now sending Sent 125550348, Got response 0, Round-trip delay 18424 microseconds so this code executes 50 times a second. h> #include <ESP8266WiFi. This code works fine, however I want to improve it to get to better time scales, by using the ESP. Note that some manufactures do not follow this. 8inch to 157inch) with an accuracy of 0. I dont get any delay even if I add some different delays. The High Resolution Timer (ESP Timer) provided by FreeRTOS uses a 64 bit hardware timer. Pulse signal is provided through a PA4 pin of TM4C123 microcontroller. Finally, an ISR has very high restrictions on timing for the executed code, meaning that executed code should not take longer than a very few microseconds. read () with simple timeout functionality. The sketch uses the callback when the time was set. Moderator: igrr 7 posts;ESP8266 Platforms; ESP8266 Arduino; General Discussions; ESP8266 how to scatter out the delays() properly. getCycleCount () function and interrupts for the timing. fn_micros: return startup system timer in microseconds. Each call to print takes only a few microseconds. Multiple pins can be set at the same time. It is the most direct replacement for the Arduino delay() method. Raising the level, the interrupt handler can reduce the timer processing delay. that include microseconds information. Below are the results: TRANSMITTER SPEED TEST Got response 26 round-trip delay: 1960 microseconds Got response 1 round-trip delay: 1964 microseconds Got response 2 round. The supported way to use WebREPL is by connecting to ESP8266 access point, but. g. delay specifies the number of microseconds after setting the pin values to wait until moving to the next state. The timebase is the same as for the values returned by esp_timer_get. Theoretically, a CPU running at twice the speed should complete a task in about one half the time. Not sure why it says error but I'm quite certain that. If you wonder how to install Arduino IDE for ESP8266 feel free to visit our tutorial on that here. ticks_ms # get millisecond counter delta = time. See the RTOS Configuration documentation for more information. Servo myservo; According to the creators of the Servo library, you can create up to 12 servo objects for the UNO and most other boards and up to 48 for the Arduino Mega. The CPU is executing at a constant processor clock rate. millis() and micros() return the number of milliseconds and microseconds elapsed after reset, respectively. On the ESP32, the bootrom is much bigger (7*64k) than on the ESP8266: ROM0 - 0x4000 0000 to 0x4006 ffff. Code: Select all delayMicroseconds (7000); // Off cycle. A positive number or. Short explanation of my project, is RFID based door security system using magnetic door lock. 2. I also used portTICK_RATE_MS but the speed didnt change . For microseconds based delay, DWT cycle counter is used to get maximal optimized delay. Remember that there is a lot of code that. cpp is in. If you’re using an ESP8266-01, you need an FTDI programmer to upload the code. Which worked out to 213-160 = 53 counts (53 x 6. 0 (ESP-12E Module) Upload speed: 115200 CPU freq: 80 MHz flash size: 4m (no spiffs) Debug port: disabled Debug level: none Iwlp variant: v2 lower memory VTables: flash exceptions: enabled Erase flash: only sketch Port: Com6. fn_write_pin: write tx pin to 0 and 1. . Pauses the program for the amount of time (in microseconds) specified as parameter. Below are the steps for configuring and using the Timer0 for delay generation: Calculate the Timer Count for the required delay. is there any progress with the timers to fire below 100us ?If you are hoping for a callback to run with anything approaching microsecond resolution you need to use a Pyboard or similar. Delay for given number of milliseconds, should be positive or 0. cpp as described below. Ticker is os_timer Each Ticker calls one function. deepSleep (uS) and pass as argument sleep time in microseconds. delayMicroseconds(us) pauses for a given number of microseconds. 3V. Apr 11, 2022 at 4:49. tmr. 2. Updating TZ. delay(ms) pauses the sketch for a given number of milliseconds and allows WiFi and TCP/IP tasks to run. PWM interval can be very long (uint32_t millisecs). time. You will see that basically we blink an IR LED for a set time, wait and repeat to create our signal. {"payload":{"allShortcutsEnabled":false,"fileTree":{"src":{"items":[{"name":"LightweightServo. Remarks for the ESP8266 and Dependencies. Actually, we have connected one module over UART with ESP32 chip in our product. If you’re using ESP8266-01, connect GPIO 0 to VCC and reset. You can change the number of repeats of the callbacks, if repeats is 0 the ticker runs in endless mode. 1 milliseconds. The part of interest is this: startTime = micros (); while (digitalRead (capPos) == HIGH) { delayMicroseconds (1); } endTime = micros (); The while loop I want to. 3 volts and LOW means 0 volts or ground. I already implemented a. 5) 4 LED with 4 Debounce buttons. h> #include <WiFiUdp. This code is written in Keil uvision. บทความ ESP8266 NodeMCU #1 สอนใช้งาน NodeMCU ESP8266 v2 ติดตั้ง NodeMCU ESP8266 ลงบน Arduino IDE #2 สอนใช้งาน NodeMCU ESP8266 v3 ติดตั้ง NodeMCU ESP8266 ลงบน Arduino IDEHere are two basic delay and timer sketches and their millisDelay library equivalents. If the pad is not configured for input (or input and output) the returned value is always 0. I am trying the run stepper motor with the tmc2208 driver and ı want to delay in microseconds like 5uS or 10 uS. Copy the above code and open with Arduino IDE. On a standard servo, this will set the angle of the shaft. On the firmware end, the Espressif SDK has made a systemdeepsleep([uint32t timein_us]) function available, which puts the ESP8266 to sleep for a specified number of microseconds. Thanks. Currently, the largest value that will produce an accurate delay is 16383. Let us now assume that 1/C is faster than the delay you want to wait. The ESP32 bootrom. สวัสดีครับ ท่านที่พึ่งหัดเขียนโปรแกรมแรกๆ มักจะได้เรียนรู้ delay กันไปแล้วแน่นอน อย่างน้อยก็ Example blink แหละนะ ฟังก์ชัน delay เป็นการหยุดรอเท่าจำนว. While delayMicroseconds() directly uses the value of the hardware timer, delay() and millis() are handled by the ISR. 0 Kudos. Yes, this will work on non CM0 (+) parts. Copy link. Star 15. It now supports 16 ISR-based synchronized PWM channels, while consuming only 1 Hardware Timer. Limited to 31 bits, after that it wraps around back to zero. I replaced the delay function by a while loop to make the cpu busy for 7000 us. Serial communication that appears. This library enables you to use Interrupt from Hardware Timers on an ESP8266-based board to create and output PWM to pins. It does some delay + gpio, and measures the timing using ccount. As we want the delay of 1 microsecond, the timer frequency must be (1/ (1 us)), i. Doing the math, you find that you need 320 NOPs to generate a 20 usec. - Simplify delay approach and improve delay_microseconds_accurate() · esphome/esphome@064c2b9There is a modification to be made – both in hardware and software – to get current consumption low. MicroPython Timer API supports allf four hardware timers. Use a resistor between GPIO16 and RST. If it is used for a timer interrupt, the delay can extend till the execution of the interrupt service routine is finished. Your new topic does not fit any of the above??? Check first. Your code in loop () will never run. I edited the example code and removed all I think it is not necessary. On AVR the delay(0) can be removed completely. The chip in an Uno or a Nano is an atmega328. Initialization. This example delays by 500ms: esp-idf-equivalent-to-arduino-delay. Fork 13. Deep sleep on the ESP8266 (at least for the Arduino project) actually resets the processor on wake, losing everything but the RTC memory. A single shot delay is one that only runs once and then stops. The docs have more information. The Timers. Servo lib has 15ms delay since ESP8266 V3. the question was specifically about the ESP32 running and Arduino sketch. Apr 11, 2022 at 4:49. Why? Because it just calls setTimeout. For example, with the Particle Photon you can use micros () to get the exact number of microseconds since 1970-01. ESP32 Timers. However, even a perfect millis() will not be good for anything faster than 1 kHz. I tried to set the PWM frequency, this works, but I want to count something at. h: #define REFRESH_INTERVAL 20000 // classic default period to refresh servos in microseconds This is according to servo specification, and has been in the code for at least 6 years. The value should be treated as opaque, suitable for use only with ticks_diff(). Navigate to the zip file you downloaded and select it. We will use this object to configure the timer interrupts. I kept it here only because on ESP8266 delay(0) calls yield(). ESP-NOW - Wrapper lib for ESP-NOW (See #2227) ESPAsyncTCP - Asynchronous TCP Library for ESP8266 and ESP32/31BYour new topic does not fit any of the above??? Check first. Do note that 64 x 64 -> 64 bit multiply is typically 4x slower than the 32 x 32 -> 64 bit multiply that was in the original question. Upload below code to your NodeMCU: #define LED D1 // Led in NodeMCU at pin GPIO16 (D0). The mode chosen is periodic and the callback function is the print command so this timer will print ‘Welcome to Microcontrollerslab’ after every 5 seconds. Or use one of . cpp did the trick! Steps: I do not know how good is the ESP8266's millis(). It’s a successor to sensors like BMP180, BMP085 or BMP183. For example, a 1. delay() – Busyloops the processor for a specified number of microseconds. Looking for advice - very confused with delay AM2321 ok. Looking for advice - very confused with delay AM2321 ok. ticks_diff. If your ESP8266 delay will absolutely trip the watchdog time if called. 3. unsigned long IRAM_ATTR micros() { return ( unsigned long ). The code is working perfectly with one lamp/pot. Then, click the “ OK ” button. the esp8266 stopped responding to pings for the duration of my script. GPIO 1: GPIO pin (unused in this project) GND: Connection to Ground. time. 9 Answers. For delays longer than a few thousand. The 975 microseconds can be. Note this that is the NodeMCU pin number and not the ESP8266 GPIO number. format: specifies the number base (for integral data types) or number of.