• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ BYTE1函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中BYTE1函数的典型用法代码示例。如果您正苦于以下问题:C++ BYTE1函数的具体用法?C++ BYTE1怎么用?C++ BYTE1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了BYTE1函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1:

void ANO_DT::Send_Senser2(s32 alt_bar,u16 alt_csb)
{
	u8 _cnt=0;
	vs32 _temp;
	
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x07;
	data_to_send[_cnt++]=0;
	
	_temp = alt_bar;
	data_to_send[_cnt++]=BYTE3(_temp);
	data_to_send[_cnt++]=BYTE2(_temp);
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	_temp = alt_csb;
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);

	data_to_send[3] = _cnt-4;
	
	u8 sum = 0;
	for(u8 i=0;i<_cnt;i++)
		sum += data_to_send[i];
	data_to_send[_cnt++] = sum;
	
	Send_Data(data_to_send, _cnt);
}
开发者ID:YuMeiLau,项目名称:UAV,代码行数:28,代码来源:ANO_DT.cpp


示例2: write_multibyte

static void write_multibyte(long i)
{
    if (BYTE1(i) != 0) buffer[last++] = BYTE1(i);
    if (BYTE2(i) != 0) buffer[last++] = BYTE2(i);
    /* always */       buffer[last++] = BYTE3(i);
    /* always */       buffer[last++] = BYTE4(i);
}
开发者ID:clerkma,项目名称:ptex-ng,代码行数:7,代码来源:ptexenc.c


示例3: Data_Send_VOTAGE

void Data_Send_VOTAGE(void)
{
	u8 _cnt=0;
	float adc;
	adc = (ADC_ConvertedValue / 4096.0) * 3.3 * 11.0;
	ADC_ConvertedValue = (u32)(adc * 100);
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x05;
	data_to_send[_cnt++]=0;
	data_to_send[_cnt++]=BYTE1(ADC_ConvertedValue);
	data_to_send[_cnt++]=BYTE0(ADC_ConvertedValue);
	data_to_send[_cnt++]=BYTE1(ADC_ConvertedValue);
	data_to_send[_cnt++]=BYTE0(ADC_ConvertedValue);
	data_to_send[_cnt++]=BYTE1(ADC_ConvertedValue);
	data_to_send[_cnt++]=BYTE0(ADC_ConvertedValue);
	data_to_send[_cnt++]=BYTE1(ADC_ConvertedValue);
	data_to_send[_cnt++]=BYTE0(ADC_ConvertedValue);
	
	data_to_send[3] = _cnt-4;
	
	u8 sum = 0;
	for(u8 i=0;i<_cnt;i++)
		sum += data_to_send[i];
	
	data_to_send[_cnt++]=sum;
	
#ifdef DATA_TRANSFER_USE_USART
	Uart2_Put_Buf(data_to_send,_cnt);
#else
	NRF_TxPacket(data_to_send,_cnt);
#endif
}
开发者ID:guruebaran,项目名称:fly0513,代码行数:33,代码来源:Data_Transfer.c


示例4: Data_Send_MotoPWM

//■4:发送PWM值
void Data_Send_MotoPWM(void)
{
	u8 _cnt=0;
	u8 i;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x06;
	data_to_send[_cnt++]=0;
	data_to_send[_cnt++]=BYTE1(Pwm_Para.motor_front_pwm);
	data_to_send[_cnt++]=BYTE0(Pwm_Para.motor_front_pwm);
	data_to_send[_cnt++]=BYTE1(Pwm_Para.motor_back_pwm);
	data_to_send[_cnt++]=BYTE0(Pwm_Para.motor_back_pwm);
	data_to_send[_cnt++]=BYTE1(Pwm_Para.motor_left_pwm);
	data_to_send[_cnt++]=BYTE0(Pwm_Para.motor_left_pwm);
	data_to_send[_cnt++]=BYTE1(Pwm_Para.motor_right_pwm);
	data_to_send[_cnt++]=BYTE0(Pwm_Para.motor_right_pwm);  //四个电机油门

	data_to_send[3] = _cnt-4;

	u8 sum = 0;
	for(i=0;i<_cnt;i++)
		sum += data_to_send[i];

	data_to_send[_cnt++]=sum;

	Uart0_Put_Buf(data_to_send,_cnt);
}
开发者ID:zcatao,项目名称:FourAxis,代码行数:28,代码来源:bluth.c


示例5: Send_Status

void ANO_DT::Send_Status(void)
{
	u8 _cnt=0;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x01;
	data_to_send[_cnt++]=0;
	vs16 _temp;
	_temp = (int)(imu.angle.x*100);
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	_temp = (int)(imu.angle.y*100);
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	_temp = (int)(imu.angle.z*100);
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	vs32 _temp2 = 0;//UltraAlt * 100;
	data_to_send[_cnt++]=BYTE3(_temp2);
	data_to_send[_cnt++]=BYTE2(_temp2);
	data_to_send[_cnt++]=BYTE1(_temp2);
	data_to_send[_cnt++]=BYTE0(_temp2);
	
	data_to_send[3] = _cnt-4;
	
	u8 sum = 0;
	for(u8 i=0;i<_cnt;i++)
		sum += data_to_send[i];
	data_to_send[_cnt++]=sum;
	
	Send_Data(data_to_send, _cnt);
}
开发者ID:yangshishu,项目名称:HexCopter,代码行数:32,代码来源:ANO_DT.cpp


示例6: Data_Send_MotoPWM

/* -------------发送PWM值---------------------------- */
void Data_Send_MotoPWM(void)
{
	uint8_t _cnt=0;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x02;
//	data_to_send[_cnt++]=0x06;
	data_to_send[_cnt++]=0;
	data_to_send[_cnt++]=BYTE1(MOTOR4);          //X轴正向电机
	data_to_send[_cnt++]=BYTE0(MOTOR4);          
	data_to_send[_cnt++]=BYTE1(MOTOR3);          //X轴负向电机
	data_to_send[_cnt++]=BYTE0(MOTOR3);
	data_to_send[_cnt++]=BYTE1(MOTOR2);          //Y轴正向电机
	data_to_send[_cnt++]=BYTE0(MOTOR2);
	data_to_send[_cnt++]=BYTE1(MOTOR1);          //Y轴负向电机
	data_to_send[_cnt++]=BYTE0(MOTOR1);
//	data_to_send[_cnt++]=BYTE1(Moto_PWM_5);
//	data_to_send[_cnt++]=BYTE0(Moto_PWM_5);
//	data_to_send[_cnt++]=BYTE1(Moto_PWM_6);
//	data_to_send[_cnt++]=BYTE0(Moto_PWM_6);
//	data_to_send[_cnt++]=BYTE1(Moto_PWM_7);
//	data_to_send[_cnt++]=BYTE0(Moto_PWM_7);
//	data_to_send[_cnt++]=BYTE1(Moto_PWM_8);
//	data_to_send[_cnt++]=BYTE0(Moto_PWM_8);
	
	data_to_send[3] = _cnt-4;
	
	uint8_t sum = 0;
	for(uint8_t i=0;i<_cnt;i++)
		sum += data_to_send[i];
	
	data_to_send[_cnt++]=sum;
	
	HAL_UART_Transmit_DMA(&huart2, data_to_send, _cnt);;
}
开发者ID:ageofflight,项目名称:2015NUEDC,代码行数:36,代码来源:Data_Transfer.c


示例7: Data_Send_Voltage

void Data_Send_Voltage(T_RC_Voltage *data)
{
	rt_uint8_t _cnt=0;
	data_to_send[_cnt++]=0XAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x05;//µçѹ¹¦ÄÜ×Ö
	data_to_send[_cnt++]=0;
	
	rt_uint16_t _temp;//µçѹ¿Ï¶¨ÎªÕý
	_temp = data->Voltage1*100;
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	
	_temp = data->Voltage2*100;
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);	
	
	_temp =  data->Voltage3*100;
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	
	data_to_send[3] = _cnt-4;
	
	
	rt_uint8_t sum = 0;
	for(rt_uint8_t i=0;i<_cnt;i++)
		sum += data_to_send[i];
	data_to_send[_cnt++]=sum;
	
	NRF24L01_TxPacket(data_to_send);
	
}
开发者ID:trigrass2,项目名称:MircoFlyV0.7,代码行数:32,代码来源:transfer_app.c


示例8: ANO_DT_Send_Power

void ANO_DT_Send_Power(u16 votage, u16 current)
{
	u8 _cnt=0;
	u16 temp;
	
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x05;
	data_to_send[_cnt++]=0;
	
	temp = votage;
	data_to_send[_cnt++]=BYTE1(temp);
	data_to_send[_cnt++]=BYTE0(temp);
	temp = current;
	data_to_send[_cnt++]=BYTE1(temp);
	data_to_send[_cnt++]=BYTE0(temp);
	
	data_to_send[3] = _cnt-4;
	
	u8 sum = 0;
	for(u8 i=0;i<_cnt;i++)
		sum += data_to_send[i];
	
	data_to_send[_cnt++]=sum;
	
	ANO_DT_Send_Data(data_to_send, _cnt);
}
开发者ID:StefanJia,项目名称:test2,代码行数:27,代码来源:ANO_DT.c


示例9: ixp4xx_copy_from

/*
 * The IXP4xx expansion bus only allows 16-bit wide acceses
 * when attached to a 16-bit wide device (such as the 28F128J3A),
 * so we can't just memcpy_fromio().
 */
static void ixp4xx_copy_from(struct map_info *map, void *to,
                             unsigned long from, ssize_t len)
{
    u8 *dest = (u8 *) to;
    void __iomem *src = map->virt + from;

    if (len <= 0)
        return;

    if (from & 1) {
        *dest++ = BYTE1(flash_read16(src-1));
        src++;
        --len;
    }

    while (len >= 2) {
        u16 data = flash_read16(src);
        *dest++ = BYTE0(data);
        *dest++ = BYTE1(data);
        src += 2;
        len -= 2;
    }

    if (len > 0)
        *dest++ = BYTE0(flash_read16(src));
}
开发者ID:jerem,项目名称:hi35xx-buildroot,代码行数:31,代码来源:ixp4xx.c


示例10: ANO_DT_Send_Version

void ANO_DT_Send_Version(u8 hardware_type, u16 hardware_ver,u16 software_ver,u16 protocol_ver,u16 bootloader_ver)
{
	u8 _cnt=0;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x00;
	data_to_send[_cnt++]=0;
	
	data_to_send[_cnt++]=hardware_type;
	data_to_send[_cnt++]=BYTE1(hardware_ver);
	data_to_send[_cnt++]=BYTE0(hardware_ver);
	data_to_send[_cnt++]=BYTE1(software_ver);
	data_to_send[_cnt++]=BYTE0(software_ver);
	data_to_send[_cnt++]=BYTE1(protocol_ver);
	data_to_send[_cnt++]=BYTE0(protocol_ver);
	data_to_send[_cnt++]=BYTE1(bootloader_ver);
	data_to_send[_cnt++]=BYTE0(bootloader_ver);
	
	data_to_send[3] = _cnt-4;
	
	u8 sum = 0;
	for(u8 i=0;i<_cnt;i++)
		sum += data_to_send[i];
	data_to_send[_cnt++]=sum;
	
	ANO_DT_Send_Data(data_to_send, _cnt);
}
开发者ID:StefanJia,项目名称:test2,代码行数:27,代码来源:ANO_DT.c


示例11: Data_Send_RCData

void Data_Send_RCData(void)
{
	u8 _cnt=0;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x03;
	data_to_send[_cnt++]=0;
	data_to_send[_cnt++]=BYTE1(Rc_D.THROTTLE);
	data_to_send[_cnt++]=BYTE0(Rc_D.THROTTLE);
	data_to_send[_cnt++]=BYTE1(Rc_D.YAW);
	data_to_send[_cnt++]=BYTE0(Rc_D.YAW);
	data_to_send[_cnt++]=BYTE1(Rc_D.ROLL);
	data_to_send[_cnt++]=BYTE0(Rc_D.ROLL);
	data_to_send[_cnt++]=BYTE1(Rc_D.PITCH);
	data_to_send[_cnt++]=BYTE0(Rc_D.PITCH);

	
	data_to_send[3] = _cnt-4;
	
	u8 sum = 0;
	for(u8 i=0;i<_cnt;i++)
		sum += data_to_send[i];
	
	data_to_send[_cnt++]=sum;
	
#ifdef DATA_TRANSFER_USE_USART
	Uart2_Put_Buf(data_to_send,_cnt);
#else
	NRF_TxPacket(data_to_send,_cnt);
#endif
}
开发者ID:guruebaran,项目名称:fly0513,代码行数:31,代码来源:Data_Transfer.c


示例12: Data_Send_OFFSET

void Data_Send_OFFSET(void)
{
	u8 _cnt=0;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x16;
	data_to_send[_cnt++]=0;
	vs16 _temp = AngleOffset_Rol*1000;
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	_temp = AngleOffset_Pit*1000;
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	
	data_to_send[3] = _cnt-4;
	
	u8 sum = 0;
	for(u8 i=0;i<_cnt;i++)
		sum += data_to_send[i];
	
	data_to_send[_cnt++]=sum;
	
#ifdef DATA_TRANSFER_USE_USART
	Uart1_Put_Buf(data_to_send,_cnt);
#else
	NRF_TxPacket(data_to_send,_cnt);
#endif
}
开发者ID:kenziD,项目名称:Other-People-Program,代码行数:28,代码来源:Data_Transfer.c


示例13: Data_Send_MotoPWM

void Data_Send_MotoPWM(void)
{
	vs16 a,b,c,d;
	a=Moto_PWM_1-1000;
	b=Moto_PWM_2-1000;
	c=Moto_PWM_3-1000;
	d=Moto_PWM_4-1000;
	u8 _cnt=0;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x06;
	data_to_send[_cnt++]=0;
	data_to_send[_cnt++]=BYTE1(a);//((Moto_PWM_1-1000));
	data_to_send[_cnt++]=BYTE0(a);//((Moto_PWM_1-1000));
	data_to_send[_cnt++]=BYTE1(b);//((Moto_PWM_2-1000));
	data_to_send[_cnt++]=BYTE0(b);//((Moto_PWM_2-1000));
	data_to_send[_cnt++]=BYTE1(c);//((Moto_PWM_3-1000));
	data_to_send[_cnt++]=BYTE0(c);//((Moto_PWM_3-1000));
	data_to_send[_cnt++]=BYTE1(d);//((Moto_PWM_4-1000));
	data_to_send[_cnt++]=BYTE0(d);//((Moto_PWM_4-1000));
	
	data_to_send[3] = _cnt-4;
	
	u8 sum = 0;
	for(u8 i=0;i<_cnt;i++)
		sum += data_to_send[i];
	
	data_to_send[_cnt++]=sum;
	
#ifdef DATA_TRANSFER_USE_USART
	Uart2_Put_Buf(data_to_send,_cnt);
#else
	NRF_TxPacket(data_to_send,_cnt);
#endif
}
开发者ID:guruebaran,项目名称:fly0513,代码行数:35,代码来源:Data_Transfer.c


示例14: vtuDownsampleImageRGBA

uint32_t * vtuDownsampleImageRGBA(const uint32_t *tex)
{
	uint32_t *smallTex = (uint32_t *)malloc(c.pageDimension * c.pageDimension);
	assert(smallTex);

	for (uint16_t x = 0; x < c.pageDimension / 2; x++)
	{
		for (uint16_t y = 0; y < c.pageDimension / 2; y++)
		{
#ifdef COLOR_CODE_MIPPED_PHYSTEX
			smallTex[y * (c.pageDimension / 2) + x] = (255 << 24) + (0 << 16) + (0 << 8) + 255;
#else
			uint32_t pix1 = tex[(y*2) * c.pageDimension + (x*2)];
			uint32_t pix2 = tex[(y*2+1) * c.pageDimension + (x*2)];
			uint32_t pix3 = tex[(y*2) * c.pageDimension + (x*2+1)];
			uint32_t pix4 = tex[(y*2+1) * c.pageDimension + (x*2+1)];

			uint32_t b1 = BYTE1(pix1) + BYTE1(pix2) + BYTE1(pix3) + BYTE1(pix4);
			uint32_t b2 = BYTE2(pix1) + BYTE2(pix2) + BYTE2(pix3) + BYTE2(pix4);
			uint32_t b3 = BYTE3(pix1) + BYTE3(pix2) + BYTE3(pix3) + BYTE3(pix4);
			uint32_t b4 = BYTE4(pix1) + BYTE4(pix2) + BYTE4(pix3) + BYTE4(pix4);


			smallTex[y * (c.pageDimension / 2) + x] =  ((b4 / 4) << 24) + ((b3 / 4) << 16) + ((b2 / 4) << 8) + (b1 / 4); // ARGB
#endif
		}
	}

	return smallTex;
}
开发者ID:caomw,项目名称:benthicQT,代码行数:30,代码来源:LibVT_Utilities.cpp


示例15: SendRcvControlQuantity

bool Communication::SendRcvControlQuantity(float aux1,float aux2,float aux3,float aux4,float aux5,float aux6)
{
	u8 _cnt=0;
	u8 data_to_send[30];
	vs16 _temp;
	
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0xAA;
	data_to_send[_cnt++]=0x03;
	data_to_send[_cnt++]=0;
	
	data_to_send[_cnt++]=BYTE1(mRcvTargetThr);
	data_to_send[_cnt++]=BYTE0(mRcvTargetThr);
	
	data_to_send[_cnt++]=BYTE1(mRcvTargetYaw);
	data_to_send[_cnt++]=BYTE0(mRcvTargetYaw);
	
	data_to_send[_cnt++]=BYTE1(mRcvTargetRoll);
	data_to_send[_cnt++]=BYTE0(mRcvTargetRoll);
	
	data_to_send[_cnt++]=BYTE1(mRcvTargetPitch);
	data_to_send[_cnt++]=BYTE0(mRcvTargetPitch);
	
	
	_temp = (int)(aux1*100);
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	
	_temp = (int)(aux2*100);
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	
	_temp = (int)(aux3*100);
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	
	_temp = (int)(aux4*100);
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	
	_temp = (int)(aux5*100);
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	
	_temp = (int)(aux6*100);
	data_to_send[_cnt++]=BYTE1(_temp);
	data_to_send[_cnt++]=BYTE0(_temp);
	


	data_to_send[3] = _cnt-4;
	u8 sum = 0;
	for(u8 i=0;i<_cnt;i++)
		sum += data_to_send[i];
	data_to_send[_cnt++] = sum;
	
	usart.SendData(data_to_send, _cnt);
	return true;
}
开发者ID:lissettecarlr,项目名称:Quadcopter,代码行数:59,代码来源:Communication.cpp


示例16: Data_Send_PID4

//¡ö8£º·¢ËÍPID4
void Data_Send_PID4(void)
{
    u8 _cnt = 0;
    data_to_send[_cnt++] = 0xAA;
    data_to_send[_cnt++] = 0xAA;
    data_to_send[_cnt++] = 0x13;
    data_to_send[_cnt++] = 0;
    vs16 _temp;
    _temp = (vs16)(PID_PID_5.P * PID_PID_5_P_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_5.I * PID_PID_5_I_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_5.D * PID_PID_5_D_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_6.P * PID_PID_6_P_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_6.I * PID_PID_6_I_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_6.D * PID_PID_6_D_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_7.P * PID_PID_7_P_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_7.I * PID_PID_7_I_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_7.D * PID_PID_7_D_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    data_to_send[3] = _cnt - 4;
    u8 sum = 0;
    for (u8 i = 0; i < _cnt; i++)
        sum += data_to_send[i];
    data_to_send[_cnt++] = sum;
#ifdef DATA_TRANSFER_USE_USART
    Sys_sPrintf(Printf_USART, data_to_send, _cnt);
#else
    NRF_TxPacket(data_to_send, _cnt);
#endif
}
开发者ID:jasongwq,项目名称:FLY,代码行数:29,代码来源:data_transfer.c


示例17: Data_Send_PID3

//¡ö8£º·¢ËÍPID3
void Data_Send_PID3(void)
{
    u8 _cnt = 0;
    data_to_send[_cnt++] = 0xAA;
    data_to_send[_cnt++] = 0xAA;
    data_to_send[_cnt++] = 0x12;
    data_to_send[_cnt++] = 0;
    vs16 _temp;
    _temp = (vs16)(PID_PID_2.P * PID_PID_2_P_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_2.I * PID_PID_2_I_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_2.D * PID_PID_2_D_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_3.P * PID_PID_3_P_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_3.I * PID_PID_3_I_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_3.D * PID_PID_3_D_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_4.P * PID_PID_4_P_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_4.I * PID_PID_4_I_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_4.D * PID_PID_4_D_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    data_to_send[3] = _cnt - 4;
    u8 sum = 0;
    for (u8 i = 0; i < _cnt; i++)
        sum += data_to_send[i];
    data_to_send[_cnt++] = sum;
#ifdef DATA_TRANSFER_USE_USART
    Sys_sPrintf(Printf_USART, data_to_send, _cnt);
#else
    NRF_TxPacket(data_to_send, _cnt);
#endif
}
开发者ID:jasongwq,项目名称:FLY,代码行数:29,代码来源:data_transfer.c


示例18: Data_Send_PID2

void Data_Send_PID2(void)
{
    u8 _cnt = 0;
    data_to_send[_cnt++] = 0xAA;
    data_to_send[_cnt++] = 0xAA;
    data_to_send[_cnt++] = 0x11;
    data_to_send[_cnt++] = 0;
    vs16 _temp;
    _temp = (vs16)(PID_ALT.P   * PID_ALT_P_MULTIPLYING  ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_ALT.I   * PID_ALT_I_MULTIPLYING  ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_ALT.D   * PID_ALT_D_MULTIPLYING  ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_POS.P   * PID_POS_P_MULTIPLYING  ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_POS.I   * PID_POS_I_MULTIPLYING  ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_POS.D   * PID_POS_D_MULTIPLYING  ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_1.P * PID_PID_1_P_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_1.I * PID_PID_1_I_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_1.D * PID_PID_1_D_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    data_to_send[3] = _cnt - 4;
    u8 sum = 0;
    for (u8 i = 0; i < _cnt; i++)
        sum += data_to_send[i];
    data_to_send[_cnt++] = sum;
#ifdef DATA_TRANSFER_USE_USART
    Sys_sPrintf(Printf_USART, data_to_send, _cnt);
#else
    NRF_TxPacket(data_to_send, _cnt);
#endif
}
开发者ID:jasongwq,项目名称:FLY,代码行数:28,代码来源:data_transfer.c


示例19: Data_Send_PID1

void Data_Send_PID1(void)
{
    u8 _cnt = 0;
    data_to_send[_cnt++] = 0xAA;
    data_to_send[_cnt++] = 0xAA;
    data_to_send[_cnt++] = 0x10;
    data_to_send[_cnt++] = 0;
    vs16 _temp;
    _temp = PID_ROL.P * PID_ROL_P_MULTIPLYING; data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = PID_ROL.I * PID_ROL_I_MULTIPLYING; data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = PID_ROL.D * PID_ROL_D_MULTIPLYING; data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = PID_PIT.P * PID_PIT_P_MULTIPLYING; data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = PID_PIT.I * PID_PIT_I_MULTIPLYING; data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = PID_PIT.D * PID_PIT_D_MULTIPLYING; data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = PID_YAW.P * PID_YAW_P_MULTIPLYING; data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = PID_YAW.I * PID_YAW_I_MULTIPLYING; data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = PID_YAW.D * PID_YAW_D_MULTIPLYING; data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    data_to_send[3] = _cnt - 4;
    u8 sum = 0;
    for (u8 i = 0; i < _cnt; i++)
        sum += data_to_send[i];
    data_to_send[_cnt++] = sum;
#ifdef DATA_TRANSFER_USE_USART
    Sys_sPrintf(Printf_USART, data_to_send, _cnt);
#else
    NRF_TxPacket(data_to_send, _cnt);
#endif
}
开发者ID:jasongwq,项目名称:FLY,代码行数:28,代码来源:data_transfer.c


示例20: Data_Send_PID5

void Data_Send_PID5(void)
{
    u8 _cnt = 0;
    data_to_send[_cnt++] = 0xAA;
    data_to_send[_cnt++] = 0xAA;
    data_to_send[_cnt++] = 0x14;
    data_to_send[_cnt++] = 0;
    vs16 _temp;
    _temp = (vs16)(PID_PID_8.P  * PID_PID_8_P_MULTIPLYING ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_8.I  * PID_PID_8_I_MULTIPLYING ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_8.D  * PID_PID_8_D_MULTIPLYING ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_9.P  * PID_PID_9_P_MULTIPLYING ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_9.I  * PID_PID_9_I_MULTIPLYING ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_9.D  * PID_PID_9_D_MULTIPLYING ); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_10.P * PID_PID_10_P_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_10.I * PID_PID_10_I_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    _temp = (vs16)(PID_PID_10.D * PID_PID_10_D_MULTIPLYING); data_to_send[_cnt++] = BYTE1(_temp); data_to_send[_cnt++] = BYTE0(_temp);
    data_to_send[3] = _cnt - 4;
    u8 sum = 0;
    for (u8 i = 0; i < _cnt; i++)
        sum += data_to_send[i];
    data_to_send[_cnt++] = sum;
#ifdef DATA_TRANSFER_USE_USART
    Sys_sPrintf(Printf_USART, data_to_send, _cnt);
#else
    NRF_TxPacket(data_to_send, _cnt);
#endif
}
开发者ID:jasongwq,项目名称:FLY,代码行数:28,代码来源:data_transfer.c



注:本文中的BYTE1函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ BYTEARRAY函数代码示例发布时间:2022-05-30
下一篇:
C++ BYTE0函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap