Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
PowerControl.cpp@0:f7568c04c1c3, 2017-05-10 (annotated)
- Committer:
- kwasymodo
- Date:
- Wed May 10 17:13:50 2017 +0000
- Revision:
- 0:f7568c04c1c3
- Child:
- 1:1bae9ab7241e
added powercontrol;
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| kwasymodo | 0:f7568c04c1c3 | 1 | #include "PowerControl.h" | 
| kwasymodo | 0:f7568c04c1c3 | 2 | |
| kwasymodo | 0:f7568c04c1c3 | 3 | PowerControl::PowerControl(PinName greenButton, PinName redButton): | 
| kwasymodo | 0:f7568c04c1c3 | 4 | _greenButton(greenButton), _redButton(redButton) | 
| kwasymodo | 0:f7568c04c1c3 | 5 | { | 
| kwasymodo | 0:f7568c04c1c3 | 6 | // _greenButton.mode(PullUp); | 
| kwasymodo | 0:f7568c04c1c3 | 7 | _greenButton.fall(this, &PowerControl::goSleep); | 
| kwasymodo | 0:f7568c04c1c3 | 8 | // _redButton.mode(PullUp); | 
| kwasymodo | 0:f7568c04c1c3 | 9 | //_red.fall(this, &MotorRPM::addSample); | 
| kwasymodo | 0:f7568c04c1c3 | 10 | } | 
| kwasymodo | 0:f7568c04c1c3 | 11 | |
| kwasymodo | 0:f7568c04c1c3 | 12 | void PowerControl::goSleep(void) | 
| kwasymodo | 0:f7568c04c1c3 | 13 | { | 
| kwasymodo | 0:f7568c04c1c3 | 14 | printf("going to sleep\r\n"); | 
| kwasymodo | 0:f7568c04c1c3 | 15 | |
| kwasymodo | 0:f7568c04c1c3 | 16 | //sleep(); | 
| kwasymodo | 0:f7568c04c1c3 | 17 | } |