Working reset, flipped logic
Dependencies: SDFileSystem emic2 mbed-rtos mbed
Fork of BAT_senior_design_Nhi by
Diff: button.cpp
- Revision:
- 33:3090ec93b4aa
- Parent:
- 32:e87bb6e83072
--- a/button.cpp Mon Nov 20 15:46:11 2017 +0000
+++ b/button.cpp Wed Nov 29 00:40:16 2017 +0000
@@ -13,6 +13,7 @@
/*button::button(PwmOut servo, DigitalIn pb, AnalogIn lp)
: servo(servo), pb(pb), linpot(lp), press(0), state(0) {}
*/
+//Serial pc(USBTX, USBRX);
// FUNCTIONS
@@ -53,6 +54,7 @@
int button::getPress()
{
+ //pc.printf("%d", press);
return press;
}
@@ -70,10 +72,11 @@
{
//myled = 1;
// rotate 90 degrees one way
- for(int i=3; i<=7; i++) {
+ for(int i=4; i<=7; i++) {
servo = i/100.0;
wait(0.01);
}
+ //press = 1;
switch (id) {
case 1:
led2 = 0;
@@ -112,7 +115,7 @@
void button::moveServoOut()
{
//myled = 0;
- for(int i=7; i>3; i--) {
+ for(int i=7; i>4; i--) {
servo = i/100.0;
wait(0.01);
}
@@ -160,7 +163,7 @@
}
void button::setup() {
- for(int i=0; i<=3; i++) {
+ for(int i=0; i<=4; i++) {
servo = i/100.0;
wait(0.01);
}
