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: Master.cpp
- Revision:
- 35:a4e89e78d034
- Parent:
- 28:21773a6fb6df
- Child:
- 37:bf257a0154db
--- a/Master.cpp Sun Nov 24 19:04:01 2013 +0000 +++ b/Master.cpp Sun Nov 24 20:18:17 2013 +0000 @@ -1,25 +1,26 @@ #include "mbed.h" - -#include "Master.hpp" +#include "include/zgeom.hpp" Serial pc(USBTX, USBRX); -QEI mEnc1(p25, p26, NC, 1200, QEI::X4_ENCODING); //hip -QEI mEnc2(p23, p24, NC, 1200, QEI::X4_ENCODING);//knee - -Motor m1(p15,p17,p18,p21,mEnc1);//hip -Motor m2(p16,p19,p20,p22,mEnc2);//knee +int main() { -QEI bEnc1(p27, p28, p29, 1200, QEI::X4_ENCODING);//change pins!!!!!!!!!!!!!!!!!!!!!!! -QEI bEnc2(p8, p9, p10, 1200, QEI::X4_ENCODING);//these too - -//Kangaroo kankan(m1,m2,bEnc1,bEnc2); - -int main() { + Point p1(1,2,3); + Point p2(2,2,3); + + Line l1(p1,p2); + + Point p3(3,2,3); + + Point bLine[3] = {p1,p2,p3}; + + BezCurve b(bLine, sizeof(bLine)/sizeof(Point)); + + b.setAdot(.025); + b.startCurve(); while(1){ - //kankan.testEncoders(pc); - pc.printf("m1: %i, enc1: %i\n",m1.getPos(), mEnc1.getPulses()); - wait(.5); + pc.printf("%f\n",b.newPoint().x); + wait(2); } }