pyb.standby() and ExtInt Line identification
Posted: Mon Sep 28, 2015 1:18 pm
Hi,
New to the forum and new to micropython but I have been playing and getting the LoNet GSM/GPS module working with my pyBoard.
As part of this I have hooked up a PIR sensor to get the board to send a REST call to a server via the LoNet board. All works okay but I want to try reducing the power consumption. All seems good with using external interrupts and getting the board to do as expected, so all is going well.
I now want to add a second sensor on a second external interrupt, and that is where my skills are failing me. How do I get the value of the external interrupt line that was triggered and woke up the board after a py.standby() or py.stop()?
Ideally, I would like to use pyb.standby() but will settle for pyb.stop() if that gives me the information that will let me identify the external interrupt that was triggered. I can see the line value in the callback from pyb.stop() but can't work out how to make it available else where in my program (it's probably a lack of understanding on the use of global on python variables, so sorry for my very basic question).
Many thanks
Carl
New to the forum and new to micropython but I have been playing and getting the LoNet GSM/GPS module working with my pyBoard.
As part of this I have hooked up a PIR sensor to get the board to send a REST call to a server via the LoNet board. All works okay but I want to try reducing the power consumption. All seems good with using external interrupts and getting the board to do as expected, so all is going well.
I now want to add a second sensor on a second external interrupt, and that is where my skills are failing me. How do I get the value of the external interrupt line that was triggered and woke up the board after a py.standby() or py.stop()?
Ideally, I would like to use pyb.standby() but will settle for pyb.stop() if that gives me the information that will let me identify the external interrupt that was triggered. I can see the line value in the callback from pyb.stop() but can't work out how to make it available else where in my program (it's probably a lack of understanding on the use of global on python variables, so sorry for my very basic question).
Many thanks
Carl