Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 10 months ago.
Small question
Hello Chris and sorry to disturb you, great and clear code you have written Discovering C++ instead of oriented object languages, so ...small question.....if you had to start the reading of the SRF08 by a ON/OFF switch, which instruction should you use ? Thanks a lot and have a nice week end
Vincent
Question relating to:
1 Answer
8 years, 10 months ago.
Hello Vincent. Consider the following approach to use an interrupt triggered by a pushbutton:
https://developer.mbed.org/users/4180_1/code/Pushbutton_Debounce_Interrupt/
Upon pressing the pushbutton, call the SRF08 sensor routine(s).
To save power, you could consider something similar in that the target board is in sleep mode till the pushbutton is pressed. Once the PB is pressed, the CPU will then wake up and then call the SRF08 routine(s).
https://developer.mbed.org/search/?type=&q=nucleo+sleep