//An exam code only #include "mbed.h" //Global Variables float *an; int ani; //Analog AnalogIn wheel_ang(PC_1); AnalogIn front_brake(PC_0); //Ticker Ticker analog_tic; //in my code there is more tickers //functions void Analog_read_all( ) { *(an+0+ani)=wheel_ang.read(); *(an+1+ani)=front_brake.read(); ani=ani+2; } // main code: int main() { ani=0; printf("start\r\n");//just for exam //call Tickers analog_tic.attach(&Analog_read_all,0.1); wait(0.2); printf("After Ticker\r\n");//just for exam while(1) { wait(0.5); analog_tic.detach(); //more in in my code in this loop printf("in while");//just for exam ani=0; //call Tickers analog_tic.attach(&Analog_read_all,0.1); } }