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.
Dependencies: SDFileSystem mbed-rtos mbed wave_player emic2
Fork of BAT_senior_design by
Diff: button.cpp
- Revision:
- 12:b80dde24e9bc
- Parent:
- 10:21268d8bf979
- Child:
- 13:581a3b02f4c3
diff -r b302c71e300f -r b80dde24e9bc button.cpp
--- a/button.cpp Wed Oct 18 14:06:19 2017 +0000
+++ b/button.cpp Wed Oct 18 14:41:04 2017 +0000
@@ -1,20 +1,25 @@
#include "mbed.h"
#include "button.h"
+// button constructor
button::button(PwmOut servo, DigitalIn pb)
: servo(servo), pb(pb) {}
// FUNCTIONS
+
+// get servo pin
PwmOut button::getServoPin()
{
return servo;
}
-int button::getState()
+// get current state of the button
+/*int button::getState()
{
return state;
-}
+}*/
+// move servo into the slot
void button::moveServoIn()
{
//myled = 1;
@@ -25,6 +30,7 @@
}
}
+// move servo out of the slot
void button::moveServoOut()
{
//myled = 0;
