We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is a problem with the ESP32 timer, and there is no response when the program is downloaded
/*
void setup() { Serial.begin(115200); pinMode(led, OUTPUT);
//设置定时器,0是定时器(4个定时器)80预分频器的值,true上升沿计数.false下降沿计数 timer=timerBegin(0,80,true); //Timer指针变量,kaiDS触发中断执行函数,Timer 触发器与时钟同步true上升沿时触发定时器false当时钟信号改变电平时触发定时器 timerAttachInterrupt(timer,&kaiDS,true); //Timer指针变量,1000000触发中断频率,true每次触发后自动重置定时器中断 timerAlarmWrite(timer,1000000,true); timerAlarmEnable(timer);//启动定时器 } void loop() { }
The text was updated successfully, but these errors were encountered:
The previous version is good
Sorry, something went wrong.
@mjkdz Please can you rewrite your issue in English?
@mjkdz Do you have any update to this issue? If not, I will close it in few days.
No branches or pull requests
There is a problem with the ESP32 timer, and there is no response when the program is downloaded
/*
/
hw_timer_ttimer = NULL;//配置定时器我们需要一个指向hw_timer_t类型变量的指针
volatile int led=2;
volatile byte ZT =0;//volatile关键字说明我们需要在中断中修改这个变量
void IRAM_ATTR kaiDS(){//定时器中断函数
ZT=!ZT;
digitalWrite(led,ZT);
}
void setup() {
Serial.begin(115200);
pinMode(led, OUTPUT);
//设置定时器,0是定时器(4个定时器)80预分频器的值,true上升沿计数.false下降沿计数
timer=timerBegin(0,80,true);
//Timer指针变量,kaiDS触发中断执行函数,Timer 触发器与时钟同步true上升沿时触发定时器false当时钟信号改变电平时触发定时器
timerAttachInterrupt(timer,&kaiDS,true);
//Timer指针变量,1000000触发中断频率,true每次触发后自动重置定时器中断
timerAlarmWrite(timer,1000000,true);
timerAlarmEnable(timer);//启动定时器
}
void loop() {
}
The text was updated successfully, but these errors were encountered: