user54181: This is the code for timer example in esp8266..(got from a website)
My doubt is where the function   timer1_enable(TIM_DIV16, TIM_EDGE, TIM_SINGLE)  is defined ??
I am look in Ticker.cpp, but not found.

#include < ESP8266WiFi.h>
#include < Ticker.h >

Ticker blinker;

#define LED 2  //On board LED

//=======================================================================
void ICACHE_RAM_ATTR onTimerISR(){
    digitalWrite(LED,!(digitalRead(LED)));  //Toggle LED Pin
    timer1_write(600000);//12us
}

void setup()
{
    Serial.begin(115200);
    Serial.println("");

    pinMode(LED,OUTPUT);

    //Initialize Ticker every 0.5s
    timer1_attachInterrupt(onTimerISR);
    timer1_enable(TIM_DIV16, TIM_EDGE, TIM_SINGLE);
    timer1_write(600000); //120000 us
}

void loop()
{
}


user4143: Those functions have nothing to do with the Ticker library. Those functions are defined in the ESP8266 core.
The example you cite has this at the top of it:

Hardware Timer0 is used by WiFi Functions. We can use only Timer1. Use of timer instead of Ticker gives advantage of precision timing and You can get timer interrupt in micro seconds.

Note the use of "instead of Ticker" there. That says that the code below has nothing to do with Ticker.

54181: <p>This is the code for timer example in esp8266..(got from a website)</p>

<p>My doubt is where the function   timer1_enable(TIM_DIV16, TIM_EDGE, TIM_SINGLE)  is defined ??
I am look in Ticker.cpp, but not found.
</p>

<pre class="lang-cpp prettyprint-override"><code>#include &lt; ESP8266WiFi.h&gt;
#include &lt; Ticker.h &gt;

Ticker blinker;

#define LED 2  //On board LED

//=======================================================================
void ICACHE_RAM_ATTR onTimerISR(){
    digitalWrite(LED,!(digitalRead(LED)));  //Toggle LED Pin
    timer1_write(600000);//12us
}

void setup()
{
    Serial.begin(115200);
    Serial.println("");

    pinMode(LED,OUTPUT);

    //Initialize Ticker every 0.5s
    timer1_attachInterrupt(onTimerISR);
    timer1_enable(TIM_DIV16, TIM_EDGE, TIM_SINGLE);
    timer1_write(600000); //120000 us
}

void loop()
{
}
</code></pre>
 4143: <p>Those functions have nothing to do with the Ticker library. Those functions are defined in the <a href="https://github.com/esp8266/Arduino/blob/master/cores/esp8266/core_esp8266_timer.cpp" rel="nofollow noreferrer">ESP8266 core</a>.</p>

<p>The example you cite has this at the top of it:</p>

<blockquote>
  <p>Hardware Timer0 is used by WiFi Functions. We can use only Timer1. <strong>Use of timer instead of Ticker</strong> gives advantage of precision timing and You can get timer interrupt in micro seconds.</p>
</blockquote>

<p>Note the use of "instead of Ticker" there. That says that the code below has nothing to do with Ticker.</p>
