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.
Diff: PowerControl.cpp
- Revision:
- 1:1bae9ab7241e
- Parent:
- 0:f7568c04c1c3
- Child:
- 2:1e3291e8294d
--- a/PowerControl.cpp Wed May 10 17:13:50 2017 +0000
+++ b/PowerControl.cpp Wed May 10 18:45:38 2017 +0000
@@ -1,17 +1,19 @@
#include "PowerControl.h"
+extern RawSerial pc;
+
PowerControl::PowerControl(PinName greenButton, PinName redButton):
_greenButton(greenButton), _redButton(redButton)
{
-// _greenButton.mode(PullUp);
+ _greenButton.mode(PullUp);
_greenButton.fall(this, &PowerControl::goSleep);
-// _redButton.mode(PullUp);
- //_red.fall(this, &MotorRPM::addSample);
+ _redButton.mode(PullUp);
+ _redButton.fall(this, &PowerControl::goSleep);
}
void PowerControl::goSleep(void)
{
- printf("going to sleep\r\n");
+ pc.printf("going to sleep\r\n");
- //sleep();
+ sleep();
}
\ No newline at end of file