# easy_do **Repository Path**: danmu_admin/easy_do ## Basic Information - **Project Name**: easy_do - **Description**: 简易使用MPY的按钮中断及时间Timer模块 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-07-09 - **Last Updated**: 2024-07-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # easy_do #### 介绍 #### 按键中断 ``` from easy import irq c=irq(0) #设置GPIO0为按键中断 可以监听tik值1为短按 2为长按 #可以使用get方法获取值,但获取后tik置0 print(c.tik) c.get() ``` #### Timer使用 ``` from easy import timer timer(dx,0,5,1) #dx函数使用Timer 0 ,5秒一次循环调用 timer(dx,0,5,2) #dx函数使用Timer 0 ,5秒后仅调用一次 timer(dx) #简易使用,dx函数使用Timer 0 ,3秒一次循环调用 ```