本文整理汇总了C++中Delayms函数的典型用法代码示例。如果您正苦于以下问题:C++ Delayms函数的具体用法?C++ Delayms怎么用?C++ Delayms使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Delayms函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _ADBOpen
unsigned char _ADBOpen()
{
u32 wait=0;
h = ADBOpen("tcp:2000", &ADBreceive);
while ((wait<1000)&&(!ADBChannelReady(h)))
{
ADBTasks();
Delayms(1);
wait++;
}
if (wait<1000) return TRUE;
else return FALSE;
}
示例2: USE_LCD
void USE_LCD(void)
{
CSOUT &= ~CS; //片选信号 CS
Delayms(15);
//为DA
UCB0CTL1 |= UCSWRST; // **Put state machine in reset**
UCB0CTL0 = UCMST+UCSYNC+UCCKPL+UCMSB; // 3-pin, 8-bit SPI master
// Clock polarity high, MSB
UCB0CTL1 |= UCSSEL_2; // SMCLK
UCB0BR0 = 0x00; // /2
UCB0BR1 = 0; //
// No modulation
UCB0CTL1 &= ~UCSWRST;
}
示例3: main
int main()
{
while(1)
{
if(P2 != 0xff) // some button was down
{
Button_Test();
Delayms(100);
}
P0 = 0xff;
}
return 0;
}
示例4: menu
/*APRIMORAR E TESTAR*/
void menu(void){
int b1, b2, digital = 0;
int menu = 0;
while(!digital){
digital = readJSButton();
b1 = readButtons('1');
b2 = readButtons('2');
if(b1||b2){
menu++;
menu %= 2;
}
if(menu == 0){
TM_HD44780_Clear();
TM_HD44780_Puts(0, 0, "MODO AUTONOMO");
TM_HD44780_PutCustom(15, 0, 0);
TM_HD44780_Puts(0, 1, "MODO MANUAL");
Delayms(50);
}else if(menu == 1){
TM_HD44780_Clear();
TM_HD44780_Puts(0, 0, "MODO AUTONOMO");
TM_HD44780_Puts(0, 1, "MODO MANUAL");
TM_HD44780_PutCustom(15, 1, 0);
Delayms(50);
}
TM_HD44780_Clear();
}
if(menu == 0){
modoPerfuracao();
//setDesenhaQuadrado();
}else if(menu == 1){
manualControl();
}
}
示例5: IRsend_sendSharp
void IRsend_sendSharp(u32 data, u16 nbits)
{
u32 invertdata = data ^ SHARP_TOGGLE_MASK;
u16 i;
PWM_setFrequency(38000);
for (i = 0; i < nbits; i++) {
if (data & 0x4000) {
IRsend_mark(SHARP_BIT_MARK);
IRsend_space(SHARP_ONE_SPACE);
}
else {
IRsend_mark(SHARP_BIT_MARK);
IRsend_space(SHARP_ZERO_SPACE);
}
data <<= 1;
}
IRsend_mark(SHARP_BIT_MARK);
IRsend_space(SHARP_ZERO_SPACE);
Delayms(46);
for (i = 0; i < nbits; i++) {
if (invertdata & 0x4000) {
IRsend_mark(SHARP_BIT_MARK);
IRsend_space(SHARP_ONE_SPACE);
}
else {
IRsend_mark(SHARP_BIT_MARK);
IRsend_space(SHARP_ZERO_SPACE);
}
invertdata <<= 1;
}
IRsend_mark(SHARP_BIT_MARK);
IRsend_space(SHARP_ZERO_SPACE);
Delayms(46);
}
示例6: main
int main(void){
SystemInit();
TM_DELAY_Init();
TM_ILI9341_Init();
TM_ILI9341_SetLayer1();
/* Initialize USART2 at 115200 baud, TX: PD5, RX: PD6 */
TM_USART_Init(USART2, TM_USART_PinsPack_2, 115200);
uint8_t wacc = 0x3A; // 0xA6
uint8_t racc = 0x3B; // 0xA7
// 0x2D POWER_CTL: Power-saving features control
TM_I2C_Write(I2C2, wacc, 0x2D, 0x08);
// 0x31 DATA_FORMAT: Data format control
//TM_I2C_Write(I2C1, wacc, 0x31, 0x0B); // FULL_RES and +- 16g
TM_I2C_Write(I2C2, wacc, 0x31, 0x01); // fixed resolution and +- 4g
// 0x2C BW_RATE: Data rate and power mode control
TM_I2C_Write(I2C2, wacc, 0x2C, 0x0A);
char str[16] = {0};
sprintf(str, "delay = 100");
TM_USART_Puts(USART2, str);
while(1){
TM_ILI9341_Fill(ILI9341_COLOR_WHITE);
TM_ILI9341_Puts(30, 30, str, &TM_Font_11x18, ILI9341_COLOR_WHITE, ILI9341_COLOR_BLUE2);
uint8_t buff[6] = {0};
int16_t tri[3] = {0};
TM_I2C_ReadMulti(I2C2, racc, 0x32, buff, 6);
// original read digit
tri[0] = (int16_t) ((uint16_t)buff[1] << 8 | (uint16_t)buff[0]);
tri[1] = (int16_t) ((uint16_t)buff[3] << 8 | (uint16_t)buff[2]);
tri[2] = (int16_t) ((uint16_t)buff[5] << 8 | (uint16_t)buff[4]);
float ftri[3] = {0}, divisor = 128.0f;
ftri[0] = (float) tri[0] / divisor;
ftri[1] = (float) tri[1] / divisor;
ftri[2] = (float) tri[2] / divisor;
sprintf(str, "%.3f,%.3f,%.3f\n\r", ftri[0], ftri[1], ftri[2]);
TM_USART_Puts(USART2, str);
TM_ILI9341_Puts(30, 50, str, &TM_Font_11x18, ILI9341_COLOR_BLACK, ILI9341_COLOR_WHITE);
Delayms(100);
}
}
示例7: main
int main(void) {
/* Initialize system */
SystemInit();
/* Initialize delay */
TM_DELAY_Init();
/* Initialize leds on board */
TM_DISCO_LedInit();
/* Turn on all leds */
TM_DISCO_LedOn(LED_ALL);
/* Delay 2 seconds */
Delayms(2000);
while (1) {
/* Toggle leds */
TM_DISCO_LedToggle(LED_ALL);
/* Wait 500ms */
Delayms(500);
}
}
示例8: LCD_Op5
void LCD_Op5() // 返回键操作
{
//0000 1 D C B
LCD_W_Cmd(0x0c);//显示on,光标off, 光标闪烁off
Delayms(1);
LCD_Display();
if(POS >= 8) // 配置闹钟,则不需要重新保存时间
Alarm_Save();
else
Time_Save();
POS = 0;
TR0 = 1; // 重新开始时钟
}
示例9: main
/*
********************************************************************************
** 函数名称 : main(void)
** 函数功能 : 主函数
** 输 入 : 无
** 输 出 : 无
** 返 回 : 无
********************************************************************************
*/
int main(void)
{
RCC_Configuration(); //配置RCC
GPIO_Configuration(); //配置GPIO
USART1_Configuration(); //配置串口1
I2C_GPIO_Config(); //配置IIC使用端口
Delayms(10); //延时
Init_MPU3050(); //初始化MPU3050
while(1)
{
READ_MPU3050(); //读取MPU3050数据
DATA_printf(TX_DATA,T_X);//转换X轴数据到数组
Send_data('X'); //发送X轴数
DATA_printf(TX_DATA,T_Y);//转换Y轴数据到数组
Send_data('Y'); //发送Y轴数
DATA_printf(TX_DATA,T_Z);//转换Z轴数据到数组
Send_data('Z'); //发送Z轴数
DATA_printf(TX_DATA,T_T);//转换温度数据到数组
Send_data('T'); //发送温度数据
USART1_SendData(0X0D); //换行
USART1_SendData(0X0A); //回车
Delayms(5); //延时
}
}
示例10: LCD_Init
void LCD_Init() //LCD初始化设定
{
unsigned char i = 0;
//显示模式设置 0011 1000, 16*2显示,5*7点阵,8位数据接口
LCD_W_Cmd(0x38);
Delayms(1);
//0000 1 D C B
LCD_W_Cmd(0x0c);//显示on,光标off, 光标闪烁off
Delayms(1);
//0000 01 N S
LCD_W_Cmd(0x06);//读写操作后指针加/减 写入字符后整屏是否左移
Delayms(1);
// 01H 数据指针清零,显示清零 02H 数据指针清零
LCD_W_Cmd(0x01); //清除LCD的显示内容
Delayms(10);
Time_Load(); // 载入时间数据
//显示数据
LCD_Display();
}
示例11: HDStartSeq
void HDStartSeq(void)
{
TM_HD44780_CreateChar(0, &customChar[0]);
TM_HD44780_Puts(0, 0, "Servo Driver\n\rSTM32F4");
Delayms(3000);
TM_HD44780_Clear();
TM_HD44780_Puts(3, 0, "MANY FUN!");
TM_HD44780_Puts(6, 1, "WOW!");
Delayms(1000);
TM_HD44780_PutCustom(0, 0, 0);
TM_HD44780_PutCustom(14, 0, 0);
TM_HD44780_PutCustom(1, 1, 0);
TM_HD44780_PutCustom(15, 1, 0);
Delayms(1000);
TM_HD44780_Clear();
}
示例12: RTNA_LCD_Init
void RTNA_LCD_Init(void)
{
MMPF_PANEL_ATTR panelAttr;
#if (SECONDARY_DISPLAY == 1)
RTNA_LCD_Init2ndLCD();
#else
RTNA_LCD_InitMainLCD();
#endif
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x051E);
Delayms(10);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x055D);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x2B01);
Delayms(10);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x000A);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x0B81);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x0194);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x041B);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x0695);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x07F0);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x1600);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x1777);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x1855);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x1901);
MMPF_LCD_Write16BitCmd(&m_PanelAttr, 0x1A20);
Delayms(10);
// 1st cmd
}
示例13: LEDdisplay
/*******************************************************************************
* 函 数 名 :LEDdisplay
* 函数功能 :循环显示各个位上的数据
* 输 入 :num要显示的数据
* 输 出 :无
*******************************************************************************/
void LEDdisplay(unsigned int num)
{
unsigned char qian,bai,shi,ge;
qian=num/1000;
bai=num%1000/100;
shi=num%100/10;
ge=num%10;
wela_1 = 1; //关闭所有数码管
wela_2 = 1;
wela_3 = 1;
wela_4 = 1;
wela_4=0; //显示千位
LED_PORT=table[qian];
Delayms(1);
LED_PORT = 0xff;
wela_4=1;
wela_3=0; //显示百位
LED_PORT=table[bai];
Delayms(1);
LED_PORT = 0xff;
wela_3=1;
wela_2=0; //显示十位
LED_PORT=table[shi];
Delayms(1);
LED_PORT = 0xff;
wela_2=1;
wela_1=0; //显示个位
LED_PORT=table[ge];
Delayms(1);
LED_PORT = 0xff;
}
示例14: KeyScan
/*******************************************************************************
* 函 数 名 :KeyScan
* 函数功能 :按键扫描
* 输 入 :无
* 输 出 :无
*******************************************************************************/
void KeyScan(void)
{
if(key_inc==0)
{
Delayms(5);
if(key_inc==0);
{
while(key_inc==0);
speed++;
if(speed > MAX_SPEED) speed = MAX_SPEED;
}
}
if(key_dec==0)
{
Delayms(5);
if(key_dec==0);
{
while(key_dec==0);
if(speed <= MIN_SPEED) speed = MIN_SPEED;
speed--;
}
}
}
示例15: InitDs1302
/*****************************************************************************
* 函 数 名:initial_ds1302
* 函数功能:初始化DS1302子程序
* 输 入:time[](全局变量)
* 输 出:
*****************************************************************************/
void InitDs1302()
{
WriteDs1302(0x8e,0x00); //写保护寄存器,在对时钟或RAM写前WP一定要为0
Delayms(5);
WriteDs1302(0x8c,time[0]); //年
Delayms(5);
WriteDs1302(0x88,time[1]); //月
Delayms(5);
WriteDs1302(0x86,time[2]); //日
Delayms(5);
WriteDs1302(0x8A,time[3]); //星期
Delayms(5);
WriteDs1302(0x84,time[4]); //时
Delayms(5);
WriteDs1302(0x82,time[5]); //分
Delayms(5);
WriteDs1302(0x80,time[6]); //秒
Delayms(5);
WriteDs1302(0x8e,0x80); //写保护寄存器
Delayms(5);
}