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

C++ delayMs函数代码示例

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

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



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

示例1: lcd_data_write

void lcd_data_write( unsigned char data )
{
	unsigned char TEMP = data;
	RS_H;		// Register Select High for Character

	if(TEMP & 0b10000000){D3_H;} else{D3_L;}
	if(TEMP & 0b01000000){D2_H;} else{D2_L;}
	if(TEMP & 0b00100000){D1_H;} else{D1_L;}
	if(TEMP & 0b00010000){D0_H;} else{D0_L;}
	E_H; delayMs(1,1); E_L;		// Pulse the Enable Pin

	if(TEMP & 0b00001000){D3_H;} else{D3_L;}
	if(TEMP & 0b00000100){D2_H;} else{D2_L;}
	if(TEMP & 0b00000010){D1_H;} else{D1_L;}
	if(TEMP & 0b00000001){D0_H;} else{D0_L;}
	E_H; delayMs(1,1); E_L;		// Pulse the Enable Pin
}
开发者ID:stuff1993,项目名称:UWS-Solar-Car-Microcontroller,代码行数:17,代码来源:lcd.c


示例2: lcd_command_write

void lcd_command_write(unsigned char command)
{
	unsigned char TEMP = command;
	RS_L;		// Register Select Low for Command

	if(TEMP & 0b10000000){D3_H;} else{D3_L;}
	if(TEMP & 0b01000000){D2_H;} else{D2_L;}
	if(TEMP & 0b00100000){D1_H;} else{D1_L;}
	if(TEMP & 0b00010000){D0_H;} else{D0_L;}
	E_H; delayMs(1,1); E_L;		// Pulse the Enable Pin

	if(TEMP & 0b00001000){D3_H;} else{D3_L;}
	if(TEMP & 0b00000100){D2_H;} else{D2_L;}
	if(TEMP & 0b00000010){D1_H;} else{D1_L;}
	if(TEMP & 0b00000001){D0_H;} else{D0_L;}
	E_H; delayMs(1,1); E_L;		// Pulse the Enable Pin
}
开发者ID:stuff1993,项目名称:UWS-Solar-Car-Microcontroller,代码行数:17,代码来源:lcd.c


示例3: do_stop

void do_stop()
{
	can_interrupt = true;
	car_set_left_speed(0);
	car_set_right_speed(0);
        CALL_BACK(STOP,FINISH);
	delayMs(100);
}
开发者ID:ShangxuanWu,项目名称:RoboCup,代码行数:8,代码来源:control.c


示例4: hardResetTarget

/**********************************************************
 * Performs a pin reset on the target
 **********************************************************/
void hardResetTarget(void)
{
  GPIO_PinOutClear((GPIO_Port_TypeDef)RESET_PORT, RESET_PIN);
  
  delayMs(50);
  
  GPIO_PinOutSet((GPIO_Port_TypeDef)RESET_PORT, RESET_PIN);
}
开发者ID:zoulincheng,项目名称:stm32chip_project,代码行数:11,代码来源:utils_old.c


示例5: do_turn_back

void do_turn_back()
{
	car_set_left_speed(0);
	car_set_left_speed(0);
	delayMs(100);
	car_change_direction();
	CALL_BACK(TURN_BACK,FINISH);
}
开发者ID:ShangxuanWu,项目名称:RoboCup,代码行数:8,代码来源:control.c


示例6: setSerialDestination

void setSerialDestination(uint8_t dest) {
// Which serial port should byteTx and byteRx talk to?
// Ensure any pending bytes have been sent. Without this, the last byte sent
// before calling this might seem to disappear.
delayMs(10);
// Configure the port.
if(dest == SERIAL_CREATE) {
PORTB &= ˜0x10;
} else {
PORTB |= 0x10;
}
// Wait a bit to let things get back to normal. According to the docs, this
// should be at least 10 times the amount of time needed to send one byte.
// This is less than 1 millisecond. We are using a much longer delay to be
// super extra sure.
delayMs(10);
}
开发者ID:NateTheBatteryFuller,项目名称:Personal-Code,代码行数:17,代码来源:codeBitsAndRandomFunctions.c


示例7: CC1101_debug

/*******************************************************************************
* Description : 
* Syntax      : 
* Parameters I: 
* Parameters O: 
* return      : 
*******************************************************************************/
void CC1101_debug(void)
{
#ifdef CC1101_RX_Debug

    //..
    
    
#endif
    
#define CC1101_TX_Debug    
#ifdef CC1101_TX_Debug   

    //..
//    memset(RF.TxBuff, 0xAA, RF_payloadSize);
//    RF.TxBuff[0] = 0xFE;
//    RF.TxBuff[1] = 0xFE;
//    RF.TxBuff[2] = 0x68;
//    RF.TxBuff[4] = 0x00;
//    RF.TxBuff[5] = 0x00;
//    RF.TxBuff[6] = 0x00;
//    RF.TxBuff[7] = 0x00;
//    RF.TxBuff[8] = 0x00;
//    RF.TxBuff[9] = 0x22;
//    RF.TxBuff[10] = 0x68;
//    RF.TxBuff[11] = 0x11;
//    RF.TxBuff[12] = 0x04;
//    RF.TxBuff[13] = 0x3F;
//    RF.TxBuff[14] = 0x34;
//    RF.TxBuff[15] = 0x33;
//    RF.TxBuff[16] = 0x37;
//    RF.TxBuff[17] = 0xE4;
//    RF.TxBuff[18] = 0x16;    
    
    while (1)
    {
        CC1101_Send(RF.TxBuff, RF_shortPayloadSize);
        delayMs(20);
    }    
//    FE FE 68 00 00 00 00 00 22 68 11 04 3F 34 33 37 E4 16 //时间
    
//    TX_buff[0] = 0x66;             // test 测试数据帧  显示表地址
//    TX_buff[1] = 0xCC;
//    TX_buff[2] = 0xCC;
//    TX_buff[3] = 0xCC;
//    TX_buff[4] = 0xCC;
//    TX_buff[5] = 0xAF;
//    TX_buff[6] = 0x33;
//    TX_buff[7] = 0x33;
//    TX_buff[8] = 0x33;
//    TX_buff[9] = 0x33;
//    TX_buff[10] = 0x33;
//    TX_buff[11] = 0x33;
//    TX_buff[12] = 0x77;
    
#endif
    

}
开发者ID:bearxiong99,项目名称:XXOO_000,代码行数:65,代码来源:RF.c


示例8: pumpLEDOffCommand

void pumpLEDOffCommand()
{
    delayMs(200);

    fillHeaderBuffer(IR_HDR_LED);
    fillCommandBuffer(IR_CMD_LED_OFF);
    sendIRCommandBlocking();
    fillHeaderBuffer(IR_HDR_HANSUN);
}
开发者ID:opensourcerebel,项目名称:SetTopBoxIRController,代码行数:9,代码来源:HansunIRController.c


示例9: RC522_reset

s8 RC522_reset()
{
    RC522_RST = 1;
    delayMs(10);
    RC522_RST = 0;
    delayMs(10);
    RC522_RST = 1;
    delayMs(100);
    RC522_SPI_read(0x02);
    RC522_SPI_write(CommandReg, Cmd_SoftReset);
    RC522_SPI_write(ModeReg, 0x3D);//和Mifare卡通讯,CRC初始值0x6363
    RC522_SPI_write(TReloadReg_L, 30);
    RC522_SPI_write(TReloadReg_H, 0);
    RC522_SPI_write(TModeReg, 0x8D);
    RC522_SPI_write(TPrescalerReg, 0x3E);
    RC522_SPI_write(TxASKReg, 0x40);
    return MI_OK;
}
开发者ID:ChenZiping,项目名称:stm32-modules-examples,代码行数:18,代码来源:RC522.c


示例10: main

/*
 *  Data  2016.5.22  Night
 *  Log   取消速度加减控制
 *        速度环变积分控制
 *        方向换取消不完全微分控制 加入分段控制
 *        直立环限幅了
 *        测试fabs()会改变内部的值吗
 */
void main (void)
 {
   DisableInterrupts;
    
    System_Init();
    //----------蜂鸣器-----------------------------------------------------------------------------------------------
    //  PTA9_O = 1;
    //  delayMs(10);
    //  PTA9_O = 0;     
    
    delayMs(30);
    SetNeutral();
    
    
    EnableInterrupts;
    
    //---------------------------等待车子到达直立---------------------------------------------------------------------
    while( g_nCarControlFlag==0 )
     {
        WaitCarStand();
        LED_FLOAT_PRINT(0,  0,"ANGLE: ",CAR_ANGLE_NOW, 4);
     }
    g_nDirectionPrior=0;// 1为方向控制优先 0为速度控制优先
    
    /*
    *  1:启动 
    *  0:关闭
    */
    g_nAngleControlFlag = 1;	/*****ANGLE_CONTROL_START*******/
    g_nSpeedControlFlag = 1;	/*****SPEED_CONTROL_START*******/
    g_nDirectionControlFlag = 1;  /*****DIRECTION_CONTROL_START***/
    
    while(1)
     { 
        //-----------------------数据发送选择区-----------------------------------
        //    switch(4)
        //    {
        //    case 1: SendData1();break;//1.MMA8451_Value   2.Angle_dot   3.Angle
        //    case 2: SendData2();break;//1.g_fAngleControlOut  2.g_fSpeedControlOut 3.g_fDirectionControlOut;
        //    case 3: SendData3();break;//1.g_nLeftMotorPulse 2.g_nRightMotorPulse
        //    case 4: SendData4();break;//1.fAngleAndSpeed  2.g_fCarSpeed
        //    case 5: SendData5();break;//1.VOLTAGE_LEFT    2.VOLTAGE_RIGHT
        //    case 6: SendData6();break;
        //    default:break;
        //    }
        //    LPLD_LPTMR_DelayMs(15);
        
        //-----------------------OLED显示区----------------------------------
        LED_FLOAT_PRINT(0,  0,"ANGLE: ",CAR_ANGLE_NOW, 4);
        LED_FLOAT_PRINT(0,  2,"L: ", VOLTAGE_LEFT, 4);
        LED_FLOAT_PRINT(0,  3,"R: ", VOLTAGE_RIGHT, 4);
        LED_FLOAT_PRINT(0,  5,"D:", g_fDirection, 4);
        
        
        
     }
 }
开发者ID:Chasingwhat,项目名称:Self-Balancing-Car,代码行数:65,代码来源:GoPro.c


示例11: goRightNoSuper

void goRightNoSuper() {
	moveXAdjusted(30);
	moveY(0);
	while(analog(0) < 127) {
		delayMs(50);
	}
	moveY(0);
	moveX(0);
}
开发者ID:jtdreisb,项目名称:multi-plexi,代码行数:9,代码来源:main.c


示例12: moveRight

void moveRight() {

	while(1) {
		moveY(0);
		moveX(30);
		while(digitalInput(0)) {
			delayMs(50);
			if(analog(0) >127) {
				return;
			}
		}
		moveX(0);
		moveY3(25);
		while(!digitalInput(0)) {
			delayMs(50);
		}
	}
}
开发者ID:jtdreisb,项目名称:multi-plexi,代码行数:18,代码来源:main.c


示例13: goForwards

void goForwards()
{
	moveX(10);
	moveY(30);
	while(!digitalInput(0)) {
		delayMs(50);
	}
	moveY(0);
}
开发者ID:jtdreisb,项目名称:multi-plexi,代码行数:9,代码来源:main.c


示例14: motorTest

void motorTest() 
{
	clearScreen();
	printString("motor test");
	buttonWait();
	clearScreen();
	printString("forwards");
	moveY(10);
	delayMs(2000);
	moveY(0);
	buttonWait();
	clearScreen();
	printString("right");
	moveX(10);
	delayMs(2000);
	moveX(0);
	clearScreen();
	printString("done");
}
开发者ID:jtdreisb,项目名称:multi-plexi,代码行数:19,代码来源:main.c


示例15: MPU_getTemp

u8 MPU_getTemp(float *temp)
{
	u8 tmp[2];
	short data;
	MPU_read(2, MPU_TEMP_OUT_H, tmp);
	data = ((s16)(tmp[0]) << 8) | tmp[1];
	*temp = 36.53 + ((double)data) / 340;
	delayMs(100);
	return 0;
}
开发者ID:ChenZiping,项目名称:stm32-modules-examples,代码行数:10,代码来源:MPU6050.c


示例16: MPU_I2C_stop

void MPU_I2C_stop()
{
	MPU_SDA_OUT();
	MPU_I2C_SDA_W = 0;
	MPU_I2C_DELAY();
	MPU_I2C_SCL = 1;
	MPU_I2C_DELAY();
	MPU_I2C_SDA_W = 1;
	delayMs(10);
}
开发者ID:ChenZiping,项目名称:stm32-modules-examples,代码行数:10,代码来源:MPU6050.c


示例17: main

/** Use this to verify that putchar() is working. printf() requires a working putchar() method. 
You should see a steady stream of 'U' output to your terminal.
This test is also useful if you are implementing a software UART and need to verify bit timing */
int main( void )
{
    halInit();
    while (1)
    {
        toggleLed(0);
        printf("U");
        delayMs(1000);
    }
}
开发者ID:arguelles-manuel,项目名称:smartmeter,代码行数:13,代码来源:hal_helper.c


示例18: main

int main(void)
{
    TRISBbits.TRISB15 = 0;
    LATBbits.LATB15 = 1;

    while(1){
        delayMs(DEBOUNCE_DELAY);
        LATBbits.LATB15 = !LATBbits.LATB15;
    }
}
开发者ID:itsfiziks,项目名称:ucontrol,代码行数:10,代码来源:demoLecture5-delayLED.c


示例19: putchar

/** Use this to verify that printf() is working.
@pre working putchar() method.
 */
int main( void )
{
    halInit();
    int num = 0;
    while (1)
    {
        printf("Hello World %u\r\n", num++);
        delayMs(1000);
    }
}
开发者ID:arguelles-manuel,项目名称:smartmeter,代码行数:13,代码来源:hal_helper.c


示例20: znpReset

/** Resets the ZNP using hardware and retrieves the SYS_RESET_IND message. 
This method is used to restart the ZNP's internal state machine and apply changes to startup options, zigbee device type, etc.
@post znpResult contains the error code, or ZNP_SUCCESS if success.
@return a pointer to the beginning of the version structure, or a pointer to indeterminate data if error.
@see Interface Specification for order of fields
*/
unsigned char* znpReset()
{
    RADIO_OFF();
    DEBUG_OFF();
    delayMs(1);
    RADIO_ON(); 
    DEBUG_ON();
    znpResult = spiPoll();              //Note: this will be different if UART
    return (znpBuf+SRSP_PAYLOAD_START);  //the beginning of the reset indication string
}
开发者ID:jackalchen,项目名称:smart-home-1,代码行数:16,代码来源:znp_interface.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ delayUs函数代码示例发布时间:2022-05-30
下一篇:
C++ delayMicroseconds函数代码示例发布时间: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