Cooper Liu
/
Eurobot2013_Co-Processor
working version with calibration done
Fork of Eurobot2013 by
main.cpp
- Committer:
- xiaxia686
- Date:
- 2012-11-14
- Revision:
- 3:8c78c15a92e3
- Parent:
- 0:92019d8564a7
- Child:
- 8:a8693e2daa00
File content as of revision 3:8c78c15a92e3:
#include "mbed.h" #include "rtos.h" #include "RFSRF05.h" #include "math.h" #include "globals.h" DigitalOut led1(LED1); DigitalOut led2(LED2); RFSRF05 My_Sonar(p13,p21,p22,p23,p24,p25,p26,p5,p6,p7,p8,p9); void Sonar_Callback(int num, float dist) { //Here is where you deal with your brand new reading ;D } void led2_thread(void const *argument) { while (true) { led2 = !led2; Thread::wait(1000); } } int main() { My_Sonar.callbackfunc = Sonar_Callback; Thread thread(led2_thread); while (true) { Thread::wait(osWaitForever); } }