Wake-up Pin 1 Troubleshoot

Hi,

I have an imp with an April board.

I am trying to wake the imp using Pin 1. Just to test out this function I have been using the example code given on the site:

function itHappened() {
server.show(“It happened!”);
}

// Configure Pin1 to be wake up pin
hardware.pin1.configure(DIGITAL_IN_WAKEUP);

imp.configure(“Pin1 Waker”, [], []);

// Enter deep sleep
server.sleepfor(3600);

However, when I apply a rising edge (Just applying a 3.3V) nothing happens. The imp stays in deep sleep.

My long term project is to connect the imp to a rotary encoder and wake the imp up when the encoder rotates by sensing the rising edge from the quadrature of ch. A/B.

I don’t have much for experience in squirrel so any help/advice would be appreciated!

Oh dear, that example is a bit bogus. The “itHappened” function won’t get called, and when the imp wakes up it will put itself to sleep again immediately, which will present the appearance of it never having woken up. Try this:

imp.configure("Pin1 Waker", [], []); server.log("Starting!"); hardware.pin1.configure(DIGITAL_IN_WAKEUP); imp.wakeup(5, function() { server.sleepfor(3600); });

Peter

Thank you for your help.

I tried your code and the imp still doesn’t appear to be waking up. Is there a better way for me to troubleshoot? I have an oscilloscope hooked up so I know the pin is seeing a rising edge…

Are you sure it is not a contact problem between your SD socket and the imp ? (see http://forums.electricimp.com/discussion/1057/imps-aprils-now-available-on-digikey#Item_14) .

That appears to be the issue. I bought my first April board from Sparkfun and it appears to be very poorly made. The USB socket and Pin 1 both didn’t work. I bought a second April board from Adafruit and all issues were solved.

This just adds to the previous issues that I have had with Sparkfun. Thanks for everyones help.