简单举例“- #include "Look_timer_beep.h"
- //添加#1
- #include "utils/debug.h"
- //添加#2
- #include "numicro/sfr/gpio"
- instance_task_Look_timer_beep_t task_Look_timer_beep(0); // 任务实例
- // 任务类 task_Look_timer_beep_t 的例程
- //添加#3
- __DEBUG//debug调试不优化便于调试
- void task_Look_timer_beep_t::routine()
- {
- // TODO: 在此编写例程的内容
- //添加#4
- using namespace sfr::gpio;
- while (true) {
- // TODO: 在此编写例程的内容
- //添加#5
- GPIOA.DOUT().DOUT2(1) //LED1灭
- .DOUT3(0) //LED2亮
- .DOUT4(1) //LED3灭
- .DOUT5(0);//LED4亮
- delay(LOOK_TICKS_PER_SEC / 2);//延时0.5S
- GPIOA.DOUT().DOUT2(0) //LED1亮
- .DOUT3(1) //LED2灭
- .DOUT4(0) //LED3亮
- .DOUT5(1);//LED4灭
- delay(LOOK_TICKS_PER_SEC / 2);//延时0.5S
- }
- }
|