本文整理匯總了C++中Delay_ms函數的典型用法代碼示例。如果您正苦於以下問題:C++ Delay_ms函數的具體用法?C++ Delay_ms怎麽用?C++ Delay_ms使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Delay_ms函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: SF_rem
void SF_rem()
{
unsigned char i,temp[6];
char txte[4],txtex[4];
int val=0;
long adr=0x111111;
for(i=0;i<6;i++) {
temp[i] = SerialFlash_ReadByte(adr);
ByteToStr(temp[i],txte);
ByteToStr(arm[i],txtex);
if(temp[i]!=arm[i]) val=1;
adr+=0x000020;
}
Delay_ms(3000);
for(i=0;i<6;i++) arm[i]=0;
strcpy(Label24.Caption,"");
DrawScreen(&System_Log_Screen);
if(val==0) {
a=0;
Box30.Color=0x00008040;
Box36.Color=0x00008040;
Image65.Visible=1;
Image66.Visible=0;
strcpy(Label25.Caption,"DISARMED");
strcpy(Label8.Caption,"DISARMED");
}
}
示例2: Ctrlwifi
//************************************
//5.2WIFI控製
//******************************
Ctrlwifi()
{
unchar i = 0;
switch(MenuStatus)
{
case 2:
// POWRONWIFI;
Str_8x16(1,0,"正在啟動WIFI");
//Init_Uart1;
while(!DialWIFI())
{
if(i++>5)
{
Str_8x16(1,0,"啟動WIFI失敗");
// POWEROFFWIF;
Delay_ms(2000);
MenuStatus = 3;
return;
}
}
Str_8x16(1,0,"啟動WIFI成功");
WIFI_RX_CONNECT==2;//默認啟動文件傳輸。
MenuStatus = 1000;
break;
case 1000:
//接收wifi客戶端軟件的命令。
break;
}
}
示例3: main
void main() { // ABRE FUNCAO PRINCIPAL: MAIN
ADCON1 = 0x06; // CONFIGURA ENTRADAS AN COMO E/S DIGITAIS
CMCON = 7; // DESLIGA COMPARADORES
// CONFIGURACOES E/S E ESTADOS INICIAIS [BINARIO]
TRISA = 0b00000000; PORTA = 0b00000000;
TRISB = 0b00000000; PORTB = 0b00000000;
TRISC = 0b00000000; PORTC = 0b00000000;
TRISD = 0b00000000; PORTD = 0b00000000;
TRISE = 0b00000000; PORTE = 0b00000000;
// ESTADOS INICIAIS DOS ACESSORIOS
RELE_1 = 0;
RELE_2 = 0;
BARRA_LEDS_1 = 0;
BARRA_LEDS_2 = 0;
RESIST = 0;
VENT = 0;
BUZZER = 0;
// PISCAR OS ACESSORIOS INDEFINIDAMENTE
while (1){
RELE_1 = ~ RELE_1;
RELE_2 = ~ RELE_2;
BARRA_LEDS_1 = ~ BARRA_LEDS_1;
BARRA_LEDS_2 = ~ BARRA_LEDS_2;
RESIST = ~ RESIST;
VENT = ~ VENT;
BUZZER = ~ BUZZER;
Delay_ms(750);
} // FECHA WHILE
} // FECHA MAIN
示例4: applicationTask
void applicationTask()
{
int16_t valueX;
int16_t valueY;
int16_t valueZ;
uint8_t txtX[ 15 ];
uint8_t txtY[ 15 ];
uint8_t txtZ[ 15 ];
valueX = accel_readXaxis();
valueY = accel_readYaxis();
valueZ = accel_readZaxis();
IntToStr( valueX, txtX );
IntToStr( valueY, txtY );
IntToStr( valueZ, txtZ );
mikrobus_logWrite( " Axis X :", _LOG_TEXT );
mikrobus_logWrite( txtX, _LOG_LINE );
mikrobus_logWrite( " Axis Y :", _LOG_TEXT );
mikrobus_logWrite( txtY, _LOG_LINE );
mikrobus_logWrite( " Axis Z :", _LOG_TEXT );
mikrobus_logWrite( txtZ, _LOG_LINE );
mikrobus_logWrite("----------------", _LOG_LINE);
Delay_ms( 5000 );
}
示例5: device_HW_reset
void device_HW_reset(void)
{
GPIO_ResetBits(WIZ_RESET_PORT, WIZ_RESET_PIN);
Delay_us(8);
GPIO_SetBits(WIZ_RESET_PORT, WIZ_RESET_PIN);
Delay_ms(50);
}
示例6: gsm4_send_sms
void gsm4_send_sms( uint8_t* rsp, uint8_t rsp_len )
{
at_cmd( "AT+CMGS=\"0643280993\"" );
at_cmd_addition( "Hello it's me, Hexiwear! :)" );
Delay_ms( 1000 );
sent_f = true;
}
示例7: pw1_pid
static void pw1_pid(void)
{
rt_uint32_t key_value;
// static double coefy2a = 0.8;
while(1)
{
LCD_Clear();
LCD_SetXY(0,0); LCD_WriteString("=====sonic_test=====");
LCD_SetXY(0, 1); LCD_WriteString("1.front pid");
LCD_SetXY(0, 2); LCD_WriteString("2.f->pid");
LCD_SetXY(0, 3); LCD_WriteString("3.side pid");
LCD_SetXY(0, 4); LCD_WriteString("4.s->pid");
LCD_SetXY(10, 1); LCD_WriteString("5.fs pid");
if(rt_mb_recv(&Mb_Key, &key_value, RT_WAITING_NO) == RT_EOK)
{
switch(key_value)
{
case key1: pole_sonic(0x01); break;
case key2: _input_pid(&sPos_Pid[eF_sonic]); break;
case key3: pole_sonic(0x02); break;
case key4: _input_pid(&sPos_Pid[eS_sonic]); break;
case key5: pole_sonic(0x03); break;
case keyback: return;
}
}
Delay_ms(10);
}
}
示例8: testNOR
uint32_t testNOR(uint32_t startAddress, uint32_t size, uint16_t bufferSize) {
uint8_t index;
uint16_t numWord;
uint16_t check;
uint8_t startBlock = startAddress / NORFLASH_SECTOR_SIZE;
uint8_t endBlock = (startAddress + size) / NORFLASH_SECTOR_SIZE;
NORFLASH_Status status;
NORFLASH_Id chipId;
NORFLASH_Init();
// for (index = startBlock; index <= endBlock; index++) {
// status = NORFLASH_EraseBlockNum(index);
// }
// SerialSendBytes("Start writing.\r\n", 16);
// for (numWord = 0; numWord < size; numWord++) {
// NORFLASH_WriteWord(startAddress + numWord, numWord);
// }
// SerialSendBytes("Memory written.\r\n", 17);
char testLine[24] = "Addr:xxxxxxxx : yyyy \r\n";
for (numWord = 0; numWord < size; numWord++) {
check = NORFLASH_ReadWord(startAddress + numWord);
getHexFromLong(testLine + 5, startAddress + numWord, 8);
getHexFromLong(testLine + 17, check, 4);
Delay_ms(1);
SerialSendBytes(testLine, 24);
}
return 0;
}
示例9: Init_MCU
/**************************************************************************************************
* Init MCU
**************************************************************************************************/
void Init_MCU() {
// Set PORTB8/7 to Open Drain output mode
GPIO_Config(&GPIOB_BASE, _GPIO_PINMASK_8, _GPIO_CFG_SPEED_50MHZ | _GPIO_CFG_OTYPE_OD | _GPIO_CFG_MODE_OUTPUT);
GPIO_Config(&GPIOB_BASE, _GPIO_PINMASK_7, _GPIO_CFG_SPEED_50MHZ | _GPIO_CFG_OTYPE_OD | _GPIO_CFG_MODE_OUTPUT);
GPIO_Digital_Output(&GPIOD_ODR, _GPIO_PINMASK_12); // LED GREEN
GPIO_Digital_Output(&GPIOD_ODR, _GPIO_PINMASK_13); // LED ORANGE
GPIO_Digital_Output(&GPIOD_ODR, _GPIO_PINMASK_14); // LED RED
GPIO_Digital_Output(&GPIOD_BASE, _GPIO_PINMASK_15); // LED BLUE
GPIO_Digital_Output(&GPIOC_ODR, _GPIO_PINMASK_5); // RF_STB
GPIO_Digital_Output(&GPIOE_ODR, _GPIO_PINMASK_4); // RF_RST
GPIO_Digital_Output(&GPIOA_IDR, _GPIO_PINMASK_0); // Button
GPIO_Alternate_Function_Enable(&_GPIO_MODULE_USART2_PA23);
UART2_Init_Advanced(19200, _UART_8_BIT_DATA, _UART_NOPARITY, _UART_ONE_STOPBIT, &_GPIO_MODULE_USART2_PA23);
//****************************************************************************
/*UART3_Init_Advanced(9600, _UART_8_BIT_DATA, _UART_NOPARITY, _UART_ONE_STOPBIT, &_GPIO_MODULE_USART3_PB10_11);
Delay_ms(100);
USART3_CR1bits.RXNEIE = 1; // enable uart rx interrupt
NVIC_IntEnable(IVT_INT_USART3); // enable interrupt vector
Delay_ms(100); // Wait for UART module to stabilize*/
//****************************************************************************
UART6_Init_Advanced(19200, _UART_8_BIT_DATA, _UART_NOPARITY, _UART_ONE_STOPBIT, &_GPIO_MODULE_USART6_PC67 );
Delay_ms(100);
// Enable Usart Receiver interrupt:
USART6_CR1bits.RXNEIE = 1; // enable uart rx interrupt
NVIC_IntEnable(IVT_INT_USART6); // enable interrupt vector
Enableinterrupts();
}
示例10: darVuelta
/* Funcion usada en modo automatico para esquivar obstaculo */
void darVuelta(){
girarDerecha();
avanzarVehiculo();
Delay_ms(1000);
girarIzquierda();
avanzarVehiculo();
}
示例11: CC2500_Reset
void CC2500_Reset(void)
{
CC2500_SendSpiData(CCxxx0_SIDLE);
Delay_ms(20);
CC2500_Select();
Delay_ms(20);
CC2500_NoSelect();
Delay_ms(40);
CC2500_SendSpiData(CCxxx0_SRES);
}
示例12: SF_mem
void SF_mem()
{
unsigned char i,l,cnt[4];
long adr=0x111111;
for(i=0;i<6;i++) {
SerialFlash_WriteByte(arm[i],adr);
adr+=0x000020;
}
strcpy(Label24.Caption," ******");
DrawScreen(&System_Log_Screen);
for(l=0;l<10;l++) {
ByteToStr(10-l,cnt);
strcpy(Label25.Caption," ");
strcat(Label25.Caption,cnt);
DrawScreen(&System_Log_Screen);
FT812_Sound_SetAndPlay(_FT812_SOUND_CLICK,_FT812_SOUND_PITCH_B3,vol);
Delay_ms(1000);
}
Box30.Color=0x00FF0000;
Box36.Color=0x00FF0000;
Image65.Visible=0;
Image66.Visible=1;
strcpy(Label25.Caption," ARMED");
strcpy(Label8.Caption," ARMED");
}
示例13: LCD_ExitSleep
//LCD退出休眠狀態
void LCD_ExitSleep() //_ILI9340C(void)
{
LCD_WRITE_CMD(0x11);//Exit Sleep
Delay_ms(120);
LCD_WRITE_CMD(0x29);//Display on
LCD_WRITE_CMD(0x2c);
}
示例14: KeyDown_Ex
/**
* @brief 獲取按鍵是否按下
* @param GPIOx 按鍵端口組
* @param kpin 端口引腳
* @retval\n 0表示沒有按下否則返回按下的時間(ms)
* @remarks 是KeyDown的擴展功能,能返回該按鍵長按的時間(ms),
* 最長時間為500ms。當一個按鍵有按下、長按若幹S時用它實現
*/
int16_t KeyDown_Ex(GPIO_TypeDef* GPIOx,uint16_t kpin)
{
static GPIO_TypeDef* oldGPIOx = 0;
static uint16_t oldkpin = 0;
uint16_t i;
// if(kpin == 0 && GPIOx == 0) {
// oldGPIOx = 0;
// oldkpin = 0;
// return 1;
// }
// if(oldGPIOx == GPIOx && oldkpin == kpin) {
// if(GPIO_ReadInputDataBit(GPIOx,kpin) == Key_Signal) {
// return 0;
// }
// else {
// oldGPIOx = 0;
// oldkpin = 0;
// }
// }
//if((GPIOx->IDR & kpin) == 0) {
i = 0;
while(i < 500 && GPIO_ReadInputDataBit(GPIOx,kpin) == Key_Signal) {
Delay_ms(10);
i+= 10;
}
return i;
}
示例15: main
int main(void)
{
uint8_t i;
uint8_t tri_table[] = { // triangular wave data table
0x80, 0x84, 0x88, 0x8C, 0x90, 0x94, 0x98, 0x9C, 0xA0, 0xA4,
0xA8, 0xAC, 0xB0, 0xB4, 0xB8, 0xBC, 0xC0, 0xC4, 0xC8, 0xCC,
0xD0, 0xD4, 0xD8, 0xDC, 0xE0, 0xE4, 0xE0, 0xDC, 0xD8, 0xD4,
0xD0, 0xCC, 0xC8, 0xC4, 0xC0, 0xBC, 0xB8, 0xB4, 0xB0, 0xAC,
0xA8, 0xA4, 0xA0, 0x9C, 0x98, 0x94, 0x90, 0x8C, 0x88, 0x84,
0x80, 0x7C, 0x78, 0x74, 0x70, 0x6C, 0x68, 0x64, 0x60, 0x5C,
0x58, 0x54, 0x50, 0x4C, 0x48, 0x44, 0x40, 0x3C, 0x38, 0x34,
0x30, 0x2C, 0x28, 0x24, 0x20, 0x1C, 0x20, 0x24, 0x28, 0x2C,
0x30, 0x34, 0x38, 0x3C, 0x40, 0x44, 0x48, 0x4C, 0x50, 0x54,
0x58, 0x5C, 0x60, 0x64, 0x68, 0x6C, 0x70, 0x74, 0x78, 0x7C
};
MCU_initialize(); // initialize MCU
Delay_ms(50); // wait for system stabilization
LCD_initialize(); // initialize text LCD module
LCD_string(0x80, " DAC0800 D/A "); // display title
LCD_string(0xC0, "Triangular Wave ");
while (1) {
for (i = 0; i < 100; i++) { // output D/A
PORTB = tri_table[i];
Delay_us(10);
}
}
return 0;
}