car_test

Dependencies:   APDS_9960 AutomationElements ESP8266 HALLFX_ENCODER HCSR04 MotorDriver PID

Fork of car_test by 涂 桂旺

main.cpp

Committer:
mab5449
Date:
2017-01-12
Revision:
0:d4b2a035ffe3
Child:
2:35738c77d454

File content as of revision 0:d4b2a035ffe3:

#include "mbed.h"

Thread thread;
DigitalOut led1(LED1);
volatile bool running = true;

// Blink function toggles the led in a long running loop
void blink(DigitalOut *led) {
    while (running) {
        *led = !*led;
        wait(1);
    }
}

// Spawns a thread to run blink for 5 seconds
int main() {
    thread.start(callback(blink, &led1));
    wait(5);
    running = false;
    thread.join();
}