kyle johnson
/
PololuQik2
Example
Fork of PololuQik2 by
Diff: main.cpp
- Revision:
- 1:1ac7b13ff4c3
--- /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); + } + } +} +