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

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "Controler.h"
00003 #include "Canal.h"
00004 #include "Communication.h"
00005 #include <vector>
00006 
00007 DigitalOut myled(LED1);
00008 
00009 Canal ch[30];
00010 
00011 Serial pc(USBTX,USBRX);;
00012 
00013 int main() {
00014 
00015     vector<uint32_t> activeChannel;
00016     
00017     while(1){
00018         
00019     ch[1].setState(1);  
00020     ch[10].setState(1);
00021     
00022     activeChannel = checkActivity(ch);
00023     
00024     sendActivityState(&pc,activeChannel);
00025         
00026         
00027     }
00028 }
00029 
00030