I have errors when I compile my program after a forced shutdown.
Unfortunately I am new to the Arduino platform and I am struggling!
I have loaded a sample timer program and get the same result as my code.
When I compile the code the following error occurs.
error: too many arguments to function ‘hw_timer_t* timerBegin(uint32_t)’
18 | Timer0_Cfg = timerBegin(0, 80, true);
| ~~~~~~~~~~^~~~~~~~~~~~~
LAB: 25
* Name: ESP32 Timer Interrupt Example
* Author: Khaled Magdy
* For More Info Visit: www.DeepBlueMbedded.com
*/
#define LED 21
hw_timer_t *Timer0_Cfg = NULL;
void IRAM_ATTR Timer0_ISR()
{
digitalWrite(LED, !digitalRead(LED));
}
void setup()
{
pinMode(LED, OUTPUT);
Timer0_Cfg = timerBegin(0, 80, true);
timerAttachInterrupt(Timer0_Cfg, &Timer0_ISR, true);
timerAlarmWrite(Timer0_Cfg, 50000, true);
timerAlarmEnable(Timer0_Cfg);
}
void loop()
{
// Do Nothing!
}
HaveAchat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.