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
main.cpp
- Committer:
- hazheng
- Date:
- 2017-02-03
- Revision:
- 5:577b582e4fe9
- Parent:
- 3:c8867972ffc7
- Child:
- 6:0682e1c90119
File content as of revision 5:577b582e4fe9:
#include "mbed.h" #include "Camera.h" #include "USBHIDServer.h" DigitalOut led(LED1, 1); int main(void) { //Camera cam; USBHIDServer server; unsigned int testCount = 0; unsigned int testCount2 = 0; char buf[5]; while (1) { led = 0; server.Update(0.0f); testCount++; if(testCount >= 10000) { testCount2++; sprintf(buf, "%d", testCount2); //server.PushUnreliableMsg('D', "Test Message!"); server.PushUnreliableMsg('D', buf); testCount = 0; } //wait(0.01); } } /* PwmOut servo(PTE20); int main() { servo.period(0.020); // servo requires a 20ms period while (1) { for(float offset=0.0; offset<0.001; offset+=0.0001) { servo.pulsewidth(0.001 + offset); // servo position determined by a pulsewidth between 1-2ms wait(0.25); } } } */