This is an alternative way to control which channel is active. is saves only the channels that are active in a vector.

Dependencies:   mbed

Fork of programmingtest by RespiratorySensor Team

Revision:
0:5ab9f1abaf4d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Controler.cpp	Sun Feb 28 15:54:13 2016 +0000
@@ -0,0 +1,28 @@
+#include "Controler.h"
+
+std::vector<uint32_t> checkActivity(Canal newChannel[]){  
+    
+    vector<uint32_t> activeChannelVector;
+    
+    for(int count = 1; count<30;count++){
+     
+     if(newChannel[count].getState() == 0){
+        
+        //the chanel is not active    
+        
+     
+     }else if(newChannel[count].getState() == 1){
+         //the chanel is active
+         
+         activeChannelVector.push_back(count);
+         
+    }else{
+        //error here
+        }
+    }    
+    
+
+    
+    return activeChannelVector;
+    
+    }
\ No newline at end of file