Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有人有一个简单的例子,它显示了如何使用 Contiki 在 TelosB 上处理外部中断。例如,当按下按钮时,MSP430 微控制器会从深度睡眠模式中唤醒,它会执行一些操作,然后切换回深度睡眠。代码片段会很有帮助。
请参阅platform/sky/dev/button-sensor.c您可以调整的一些示例代码。
platform/sky/dev/button-sensor.c
对于您的用例,可能只使用 Contiki 已经提供的更高级别的传感器 API 就足够了。有一个button_sensor对象;请参阅examples/sky/test-button.c示例应用程序。
button_sensor
examples/sky/test-button.c