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.
Fork of Greifer by
Revision 1:7ed3d8017cd4, committed 2017-05-04
- Comitter:
- EpicG10
- Date:
- Thu May 04 19:10:52 2017 +0000
- Parent:
- 0:aace975d101e
- Commit message:
- h
Changed in this revision
diff -r aace975d101e -r 7ed3d8017cd4 Greifer.cpp --- a/Greifer.cpp Fri Mar 24 15:36:19 2017 +0000 +++ b/Greifer.cpp Thu May 04 19:10:52 2017 +0000 @@ -8,21 +8,27 @@ Greifer::Greifer() { - init(); + //init(); } void Greifer::init() { ServoGreifer.calibrate(0.0017f, 180.0f); - ServoGreifer.position(-30.0f); + ServoGreifer.position(60.0f); } -void Greifer::take() +int Greifer::leave() { - ServoGreifer.position(90.0f); + ServoGreifer.position(60.0f); + t=0; + l=1; + return l; } -void Greifer::leave() +int Greifer::take() { - ServoGreifer.position(-30.0f); + ServoGreifer.position(-150.0f); + t=1; + l=0; + return t; } \ No newline at end of file
diff -r aace975d101e -r 7ed3d8017cd4 Greifer.h --- a/Greifer.h Fri Mar 24 15:36:19 2017 +0000 +++ b/Greifer.h Thu May 04 19:10:52 2017 +0000 @@ -16,10 +16,11 @@ Greifer(); void init(); - void take(); - void leave(); + int take(); + int leave(); - + private: + int t,l; }; #endif
diff -r aace975d101e -r 7ed3d8017cd4 main.cpp --- a/main.cpp Fri Mar 24 15:36:19 2017 +0000 +++ b/main.cpp Thu May 04 19:10:52 2017 +0000 @@ -7,9 +7,9 @@ while(1) { Greifer.take(); - wait(1.0f); + wait(5.0f); Greifer.leave(); - wait(1.0f); + wait(5.0f); }