We are going to win! wohoo

Dependencies:   mbed mbed-rtos

main.cpp

Committer:
madcowswe
Date:
2012-11-14
Revision:
8:a8693e2daa00
Parent:
3:8c78c15a92e3

File content as of revision 8:a8693e2daa00:

#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);
    }
}