Hi there, plese i want some one to help me. i want to change this code

  current_time = micros();
  //Channel 1=========================================
  if(PINB & B00000001){                                        //Is input 8 high?
    if(last_channel_1 == 0){                                   //Input 8 changed from 0 to 1
      last_channel_1 = 1;                                      //Remember current input state
      timer_1 = current_time;                                  //Set timer_1 to current_time
  else if(last_channel_1 == 1){                                //Input 8 is not high and changed from 1 to 0
    last_channel_1 = 0;                                        //Remember current input state
    receiver_input_channel_1 = current_time - timer_1;         //Channel 1 is current_time - timer_1

i want to change thos codeby this function

attachInterrupt(CHANNEL_1_PIN, calcSignal, CHANGE); i'm using arduino due, so the code on the top it's only for arduino uno. please help

What have you tried?

What happened when you tried it?

Please post a complete program.


i want to change this code

To do what, instead?

Hi, yes what do i instead ?. i’m working on arduino due and i want to do a fast ISR. i read the datasheet of arm cortex m3. but idon"t understanding how to do a fast isr on arduin due. i i should do the same isr of arduino uno " the code i posted" i want to do the same code but on arduino due.