SmartWheels self-driving race car. Designed for NXP Cup. Uses FRDM-KL25Z, area-scan camera, and simple image processing to detect and navigate any NXP spec track.
Dependencies: TSI USBDevice mbed-dev
Fork of SmartWheels by
Diff: main.cpp
- Revision:
- 10:fedb5786a109
- Parent:
- 8:92f6baeea027
- Child:
- 11:676ea42afd56
diff -r b72e18f80f49 -r fedb5786a109 main.cpp --- a/main.cpp Mon Feb 06 21:07:52 2017 +0000 +++ b/main.cpp Tue Feb 07 18:20:38 2017 +0000 @@ -3,27 +3,30 @@ #include "Motor.h" #include "USBHIDServer.h" + +#include "PinAssignment.h" -PwmOut servo(PTE20); +PwmOut servo(ST_SERVO); DigitalOut led(LED1, 1); int main(void) { servo.period(0.020); - + servo.pulsewidth(0.00185); //Camera cam; Motor motor; - motor.setLeftSpeed(0.9f); - motor.setRightSpeed(0.9f); + motor.setLeftSpeed(0.5f); + motor.setRightSpeed(0.5f); + + wait(5); + + servo.pulsewidth(0.0012); + motor.setLeftSpeed(0.5f); + motor.setRightSpeed(0.5f); wait(2); - motor.setLeftSpeed(-0.9f); - motor.setRightSpeed(-0.9f); - - wait(3); - motor.setLeftSpeed(-0.0f); motor.setRightSpeed(-0.0f);