AttachInterrupt()
来自YFRobotwiki
描述
Digital Pins With Interrupts
attachInterrupt的第一个参数是中断号。 通常,您应该使用digitalPinToInterrupt(引脚)将实际的数字引脚转换为特定的中断号。 例如,如果连接到引脚3,则使用digitalPinToInterrupt(3)作为attachInterrupt的第一个参数。
| Board | Digital Pins Usable For Interrupts |
| Uno, Nano, Mini, other 328-based | 2, 3 |
| Mega, Mega2560, MegaADK | 2, 3, 18, 19, 20, 21 |
| Micro, Leonardo, other 32u4-based | 0, 1, 2, 3, 7 |
| Zero | all digital pins, except 4 |
| MKR1000 Rev.1 | 0, 1, 4, 5, 6, 7, 8, 9, A1, A2 |
| Due | all digital pins |
| 101 | all digital pins (Only pins 2, 5, 7, 8, 10, 11, 12, 13 work with CHANGE |
语法
参数
返回
扩展阅读
- - byte
更多建议和问题欢迎反馈至 YFRobot论坛