瀏覽代碼

Merge e7c5bac641 into dda3305ce1

pull/6/merge
Nelson Neves 12 年之前
父節點
當前提交
5445f848df
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. +6
    -2
      examples/wfi.c

+ 6
- 2
examples/wfi.c 查看文件

@@ -35,7 +35,9 @@
// What BCM_GPIO input are we using?
// GPIO 0 is one of the I2C pins with an on-board pull-up

// Please note that on PCB REV2.0 GPIO0 is now GPIO2
#define BUTTON_PIN 0
//#define BUTTON_PIN 2

// Debounce time in mS

@@ -89,7 +91,7 @@ PI_THREAD (waitForIt)

// Wait for key to be released

while (digitalRead (0) == LOW)
while (digitalRead (BUTTON_PIN) == LOW)
delay (1) ;

debounceTime = millis () + DEBOUNCE_TIME ;
@@ -110,7 +112,9 @@ void setup (void)
// Use the gpio program to initialise the hardware
// (This is the crude, but effective bit)

system ("gpio edge 0 falling") ;
char cmd[80] ;
sprintf (cmd, "gpio edge %d falling", BUTTON_PIN) ;
system (cmd) ;
system ("gpio export 17 out") ;
system ("gpio export 18 out") ;



Loading…
取消
儲存