 float pos_err = 0.f, vz_target = 0.f;
 
 float bc,bc1,bc2,bc3;
+signed char baro_counter = 0;
 
 int alt_hold = 0;
 float alt_hold_target;

	sendPacket(30,alt_hold_target);
	sendPacket(31,alt);
	sendPacket(32,vz);
//	sendPacket(33,accel_err*100.f);
}
#endif


#ifdef ALTHOLD
			case 14: //altitude reading in cm - convert it into altitude error 
				 static float b;
				 baro_counter = 100; //use this baro reading not more than 100 times
				 if (!buf_space(&alt_buf)) b = buf_pop(&alt_buf); //buffer full
				 else b = alt_base;
				 alt_err = v - (b + alt_corr);
