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

Dependencies:   mbed

main.cpp

Committer:
Jamess
Date:
2016-02-28
Revision:
0:5ab9f1abaf4d

File content as of revision 0:5ab9f1abaf4d:

#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);
        
        
    }
}