if (cc != oldValue[i]) help needed *SOLVED*

Maybe this can be of some help:

void DoCC( int new_CC ){

  static int prev_CC = 0;

  if( new_CC >= ( prev_CC + 3 ) || new_CC <= ( prev_CC - 3 ) ){
    
    prev_CC = new_CC;
    //Send CC
  }
}