安装软件的步骤看大叔和李老师发的那个贴就行了,我这里给个链接:
https://bbs.21ic.com/frame.php?frameon=yes&referer=http%3A//bbs.21ic.com/iclist-78.html
然后一步步配置。后面我贴出来的是主函数,效果就是灯一闪一闪的。
- #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)
- .DOUT3(0)
- .DOUT4(1)
- .DOUT5(0);
- delay(LOOK_TICKS_PER_SEC / 1);
- GPIOA.DOUT().DOUT2(0)
- .DOUT3(1)
- .DOUT4(0)
- .DOUT5(1);
- delay(LOOK_TICKS_PER_SEC / 1);
- }
- }
|