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/main.cpp	Sun Feb 28 15:54:13 2016 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "Controler.h"
+#include "Canal.h"
+#include "Communication.h"
+#include <vector>
+
+DigitalOut myled(LED1);
+
+Canal ch[30];
+
+Serial pc(USBTX,USBRX);;
+
+int main() {
+
+    vector<uint32_t> activeChannel;
+    
+    while(1){
+        
+    ch[1].setState(1);  
+    ch[10].setState(1);
+    
+    activeChannel = checkActivity(ch);
+    
+    sendActivityState(&pc,activeChannel);
+        
+        
+    }
+}
+
+