DuckieTownCarHS

Dependencies:   TCS3200 X_NUCLEO_IKS01A2 mbed-rtos mbed

Fork of DuckieTownCar by Domenico Francesco De Angelis

Revision:
0:65ecca01ac5c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Feb 15 13:27:01 2017 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "rtos.h"
+#include "DuckieTownCar.h"
+
+/*
+* Utilizzo il RTOS-MBED! perchè?
+* Perchè ho la necessità di avere le info dai sensori senza essere bloccante
+*/
+
+DuckieTownCar* car = DuckieTownCar::getInstance();
+
+Mutex car_mutex; 
+ 
+void update_car(void const *args){
+    car_mutex.lock();
+    car->updateStateCar();
+    car_mutex.unlock();
+}
+
+int main(){
+    Thread th_update(update_car);
+    car_mutex.lock();
+    car->initCarSensor();
+    car_mutex.unlock();
+    
+    car->executeRandom();
+    return 0;    
+}
\ No newline at end of file