source: rtos_arduino/trunk/arduino_lib/libraries/Rest/examples/rest_ext_interrupt/rest_ext_interrupt.ino@ 136

Last change on this file since 136 was 136, checked in by ertl-honda, 8 years ago

ライブラリとOS及びベーシックなサンプルの追加.

File size: 1000 bytes
Line 
1/*********************************************************************************************************************************************************************************
2* This sketch demonstrates how sleep function using external interrupt to wake up the MCU.
3 This sketch work only for M0 or M0PRO boards.
4*********************************************************************************************************************************************************************************/
5
6
7
8#include <rest.h>
9
10rest mcu_std;
11
12unsigned int i=0;
13
14void setup()
15{
16
17 //SerialUSB.begin(9600); //serial settings
18 mcu_std.begin(WAKE_EXT_INTERRUPT,8,prova); //standby setup for external interrupts
19
20
21}
22
23void loop()
24{
25 for(i=0; i<20; i++)
26 {
27 digitalWrite(13,HIGH);
28 delay(100);
29 digitalWrite(13,LOW);
30 delay(500);
31 }
32
33 mcu_std.standby(); //now mcu go to standby
34
35}
36
37
38void prova(void) //interrupt routine (isn't necessary to execute any tasks in this routine
39{
40
41}
Note: See TracBrowser for help on using the repository browser.