kyle johnson
/
PololuQik2
Example
Fork of PololuQik2 by
Revision 1:1ac7b13ff4c3, committed 2014-09-15
- Comitter:
- johnson6987
- Date:
- Mon Sep 15 18:25:20 2014 +0000
- Parent:
- 0:511d65ef1276
- Commit message:
- PololuQik2 Example
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 511d65ef1276 -r 1ac7b13ff4c3 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Sep 15 18:25:20 2014 +0000 @@ -0,0 +1,40 @@ +#include "mbed.h" +#include "PololuQik2.h" +#include "CRC7.h" + + +void Error() +{ + printf("ERROR"); +} + +//(PinName TxPin, PinName RxPin, PinName RSTPin, PinName errPin, void(*errorFunction)(void), bool enCRC) +PololuQik2 driver1(p9,p10,p11,p12,&Error,0); + + + +int main() +{ + + driver1.begin(); + + + while (1) { + for(int x=0; x<=127; x++) { + driver1.setMotor0Speed(x); + driver1.setMotor1Speed(x); + wait(.05); + } + for(int x=127; x>=-127; x--) { + driver1.setMotor0Speed(x); + driver1.setMotor1Speed(x); + wait(.05); + } + for(int x=-127; x<0; x++) { + driver1.setMotor0Speed(x); + driver1.setMotor1Speed(x); + wait(.05); + } + } +} +
diff -r 511d65ef1276 -r 1ac7b13ff4c3 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Sep 15 18:25:20 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721 \ No newline at end of file