kh
Dependencies: mbed PinDetect Servo
Revision 3:2f7a7e2cd49e, committed 2018-11-13
- Comitter:
- Sayak97
- Date:
- Tue Nov 13 03:19:06 2018 +0000
- Parent:
- 2:04bbd14722bd
- Commit message:
- DSFDS; ;
Changed in this revision
diff -r 04bbd14722bd -r 2f7a7e2cd49e actuators.cpp --- a/actuators.cpp Mon Nov 12 23:36:11 2018 +0000 +++ b/actuators.cpp Tue Nov 13 03:19:06 2018 +0000 @@ -8,8 +8,9 @@ #include "Servo.h" -Servo rcServo1(p23); // pwm -Servo rcServo2(p24); // pwm +Servo rcServo1(p21); // pwm +Servo rcServo2(p22); // pwm +Servo middle(p23); /* * Function: turnsRcServosRight @@ -43,6 +44,8 @@ * Opens the safe */ void openSafe() { + middle = 1.0f; + wait(1); turnsRcServosRight(); } @@ -53,6 +56,8 @@ */ void lockSafe() { turnsRcServosLeft(); + wait(3); + middle = 1.0f; }
diff -r 04bbd14722bd -r 2f7a7e2cd49e authentication.cpp --- a/authentication.cpp Mon Nov 12 23:36:11 2018 +0000 +++ b/authentication.cpp Tue Nov 13 03:19:06 2018 +0000 @@ -18,14 +18,15 @@ int entryNum4; -AnalogIn pot1(p18); -AnalogIn pot2(p18); -AnalogIn pot3(p20); -AnalogIn pot4(p20); +AnalogIn pot1(p15); +AnalogIn pot2(p16); +AnalogIn pot3(p18); +AnalogIn pot4(p19); bool bluetoothCode = false; bool bluetoothSetup = false; Serial blue(p28,p27); +Serial pc(USBTX, USBRX); /* * Function: setEntrySequence @@ -33,10 +34,10 @@ * Reads in user's entry sequence attempt */ void setEntrySequenceAttempt() { - entryNum1 = float(pot1) * 10; - entryNum2 = float(pot2) * 10; - entryNum3 = float(pot3) * 10; - entryNum4 = float(pot4) * 10; + entryNum1 = float(pot1) * 6; + entryNum2 = float(pot2) * 6; + entryNum3 = float(pot3) * 6; + entryNum4 = float(pot4) * 6; } /* @@ -61,6 +62,11 @@ return (checkPot(p1,entryNum1) && checkPot(p2,entryNum2) && checkPot(p3,entryNum3) && checkPot(p3,entryNum3)); } +void printPotValues() { + pc.printf("pot1 is %f", pot1); + +} + bool checkPot(int p1, int p2) { return (p2 - p1) < 2 && (p1 - p2) > -2;
diff -r 04bbd14722bd -r 2f7a7e2cd49e authentication.h --- a/authentication.h Mon Nov 12 23:36:11 2018 +0000 +++ b/authentication.h Tue Nov 13 03:19:06 2018 +0000 @@ -24,6 +24,7 @@ bool checkBluetooth(); +void printPotValues(); /* * Function: bluetooth
diff -r 04bbd14722bd -r 2f7a7e2cd49e main.cpp --- a/main.cpp Mon Nov 12 23:36:11 2018 +0000 +++ b/main.cpp Tue Nov 13 03:19:06 2018 +0000 @@ -38,6 +38,7 @@ state = lock(); } wait(.5); + } }