Projet_S5 / Mbed 2 deprecated Repo_Noeud_Mobile_refactor

Dependencies:   mbed-rtos mbed

Fork of Repo_Noeud_Mobile by Projet_S5

Revision:
7:ce6e58c5a119
Parent:
5:2b539028e5a9
Parent:
6:fd1bf5563299
Child:
8:51f6c8f59449
--- a/main.cpp	Thu Mar 05 19:21:29 2015 +0000
+++ b/main.cpp	Thu Mar 05 19:25:05 2015 +0000
@@ -1,38 +1,62 @@
 /* S5 Projet - Conception d'un systeme embarque reseaute
  * main.cpp
- * 
+ *
  * @author Equipe de projet 2
- * 
+ *
  */
+
+// System libraries
 #include "mbed.h"
 #include "rtos.h"
+
+// Proprietary libraries
+#include "CountDown.h"
 #include "FlexSensor.h"
+<<<<<<< local
 #include "CountDown.h"
 #include "Cible.h"
+=======
+#include "MMA8452Q.h"
+>>>>>>> other
 
 #define GO 0x01
 
 enum GameMode { GUNNER, RPS, AirGuitar};
 
-//PROTOTYPES DE FONCTION 
+//PROTOTYPES DE FONCTION
 void gunner(void const* args);
 void rps(void const* args);
 void airGuitar(void const* args);
+void accelTesting(void const* args);
 
 FlexSensor index(DIGITAL, p15);       // flex sensor 1.
 FlexSensor majeur(DIGITAL, p16);      // flex sensor 2.
 FlexSensor annulaire(DIGITAL, p17);   // flex sensor 3.
 CountDown countDown;
+Accel accel;
 
-Thread* gunner_thread_ptr = NULL;
-Thread* rps_thread_ptr = NULL;
-Thread* airguitar_thread_ptr = NULL;
+Thread* gunner_thread_ptr = NULL;       // Possiblement mettre dans un tableau
+Thread* rps_thread_ptr = NULL;          // avec des position codees
+Thread* airguitar_thread_ptr = NULL;    // dans des define. guillaume
 
 int main(void const* args)
 {
+<<<<<<< local
     GameMode mode(GUNNER);
     switch(mode)
     {
+=======
+    // Initializing the accelerometer
+    accel = Accel();
+    accel.init_MMA8452();
+
+    RtosTimer sync(accelTesting, osTimerPeriodic, (void *)0);
+    
+
+    GameMode mode = GUNNER;
+    countDown.run();
+    switch(mode) {
+>>>>>>> other
         case GUNNER:
             gunner_thread_ptr =  new Thread(gunner);
             break;
@@ -45,11 +69,18 @@
         default:
             break;
     }
+<<<<<<< local
     while(1){
         }
+=======
+    sync.start(250);
+    while(1) {
+    }
+>>>>>>> other
 }
 
 void gunner(void const* args)
+<<<<<<< local
 { 
     // local variables 
     Cible* cible = new Cible();
@@ -63,15 +94,22 @@
             
         cible->set(target);
         countDown.run();
+=======
+{
+    // local variables
+
+    while(true) {
+        Thread::signal_wait(GO);
+        // code...
+>>>>>>> other
     }
 }
 
 void rps(void const* args)
 {
-    // local variables 
-    
-    while(true)
-    {
+    // local variables
+
+    while(true) {
         Thread::signal_wait(GO);
         // code...
     }
@@ -79,13 +117,16 @@
 
 void airGuitar(void const* args)
 {
-    // local variables 
-    
-    while(true)
-    {
+    // local variables
+
+    while(true) {
         Thread::signal_wait(GO);
         // code...
     }
 }
 
+void accelTesting(void const* args)
+{
+    accel.get_axis_values();
+}