#include "servo.h"

int global1,global2;

void init_global(){
 global1 = 1000;
 global2 = 850;
}

void pos_init(){
  
  TBCCR1 =650+global1;
  TBCCR2 =650+global2;
}

void pos1(int a){
 
  if((global1 <=1350) && (global1>=450))
  {
  global1 += a;
  TBCCR1 =650+global1;
  }
  else if(global1 > 1350) global1 = 1350;
       else global1 = 450;
}

void pos2(int a){
  
  if((global2 <=1680) && (global2>=0))
  {
   global2 += a;
   TBCCR2 =650+global2;
  }
  else if(global2 > 1680) global2 = 1680;
       else global2 = 0;
}


