这篇教程C++ Delay1KTCYx函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Delay1KTCYx函数的典型用法代码示例。如果您正苦于以下问题:C++ Delay1KTCYx函数的具体用法?C++ Delay1KTCYx怎么用?C++ Delay1KTCYx使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Delay1KTCYx函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: LCD_initvoid LCD_init(void){ unsigned char inits[7] = {0x33, 0x32, 0x28, 0x01, 0x0c, 0x06, 0x00}; unsigned char temp; char i; TRISD &= 0b00001111; //set high nibble of portd to output RS_SIG = 0; E_SIG = 0; E_TRIS = 0; RS_TRIS = 0; memset(lcdtext, ' ', sizeof(lcdtext)-1); Delay10KTCYx(25); for( i = 0; i < 7; i++ ) { E_SIG = 1; temp = inits[i]; temp &= 0b11110000; LATD &= 0b00001111; LATD |= temp; E_SIG = 0; Delay1KTCYx(25); E_SIG = 1; temp = inits[i] << 4; temp &= 0b11110000; LATD &= 0b00001111; LATD |= temp; E_SIG = 0; Delay1KTCYx(25); } }
开发者ID:sbobovyc,项目名称:uav_p18f87k22,代码行数:34,
示例2: LCD_wvoid LCD_w(unsigned char a){ unsigned char cs = SPI_CUR_SEL; unsigned char ret=1; if(cs == SPI_LCD) { SPI_Device_Select(SPI_MEM); Delay1KTCYx(1); } while(ret) { SPI_Device_Select(SPI_LCD); Delay1KTCYx(1); ret = rw_spi_byte(MAX3100_WRITE); if(ret & 64) { rw_spi_byte(a); ret = 0; } else ret = 1; if(cs != SPI_LCD) SPI_Device_Select(cs); else SPI_Device_Select(SPI_GPS); } }
开发者ID:seiferteric,项目名称:senior-project-aptt-code,代码行数:25,
示例3: piscaVermelhovoid piscaVermelho (void){ LED2=1; Delay1KTCYx(15); LED2=0; Delay1KTCYx(85); }
开发者ID:Sel2016,项目名称:microchip,代码行数:7,
示例4: config_SPI_devsvoid config_SPI_devs(void){ char a = 0; if(SPI_CUR_SEL == 0) { SPI_Device_Select(1); Delay1KTCYx(10); } for(a=0;a<4;a++) { SPI_Device_Select(a); Delay1KTCYx(10); switch(a) { case SPI_GPS: rw_spi_byte(MAX3100_WCONFIGR); rw_spi_byte(UART_4800); break; case SPI_UART: rw_spi_byte(MAX3100_WCONFIG); rw_spi_byte(UART_115200); break; case SPI_LCD: rw_spi_byte(MAX3100_WCONFIG); rw_spi_byte(UART_9600); break; case SPI_MEM: rw_spi_byte(MAX3100_WCONFIG); rw_spi_byte(UART_9600); //Change Speed Later break; default: Nop(); break; } } SPI_Device_Select(SPI_GPS); //Unselect last device to let config take place}
开发者ID:seiferteric,项目名称:senior-project-aptt-code,代码行数:35,
示例5: HeartBeatvoid HeartBeat(void){ ACT_LED_01 = 0; Delay1KTCYx(100); ACT_LED_01 = 1; Delay1KTCYx(100); WriteUSART('#'); // : while (BusyUSART());}
开发者ID:korbah,项目名称:manticord,代码行数:10,
示例6: OpenXLCDvoid OpenXLCD(unsigned char lcdtype){// 4-bit mode#ifdef UPPER // Upper 4-bits of the port DATA_PORT &= 0x0f; TRIS_DATA_PORT &= 0x0F;#else // Lower 4-bits of the port DATA_PORT &= 0xf0; TRIS_DATA_PORT &= 0xF0;#endif TRIS_RW = 0; // All control signals made outputs TRIS_RS = 0; TRIS_E = 0; RW_PIN = 0; // R/W pin made low RS_PIN = 0; // Register select pin made low E_PIN = 0; // Clock pin made low // Delay for 15ms to allow for LCD Power on reset DelayPORXLCD(); //-------------------reset procedure through software---------------------- WriteCmdXLCD(0x30); Delay1KTCYx(33); WriteCmdXLCD(0x30); Delay1KTCYx(0x01); WriteCmdXLCD(0x32); while( BusyXLCD() );//------------------------------------------------------------------------------------------ // Set data interface width, # lines, font while(BusyXLCD()); // Wait if LCD busy WriteCmdXLCD(lcdtype); // Function set cmd // Turn the display on then off while(BusyXLCD()); // Wait if LCD busy WriteCmdXLCD(DOFF&CURSOR_OFF&BLINK_OFF); // Display OFF/Blink OFF while(BusyXLCD()); // Wait if LCD busy WriteCmdXLCD(DON&CURSOR_ON&BLINK_ON); // Display ON/Blink ON // Clear display while(BusyXLCD()); // Wait if LCD busy WriteCmdXLCD(0x01); // Clear display // Set entry mode inc, no shift while(BusyXLCD()); // Wait if LCD busy WriteCmdXLCD(SHIFT_CUR_LEFT); // Entry Mode // Set DD Ram address to 0 while(BusyXLCD()); // Wait if LCD busy SetDDRamAddr(0x80); // Set Display data ram address to 0 return;}
开发者ID:sektor1986,项目名称:PULT_MTZ,代码行数:55,
示例7: sendTestvoid sendTest() { Write1USART(Test[0]); Delay1KTCYx(4); Write1USART(Test[1]); Delay1KTCYx(4); Write1USART(Test[2]); Delay1KTCYx(4); Write1USART(Test[3]); Delay1KTCYx(4); Write1USART('/n');}
开发者ID:jbowen93,项目名称:Portfolio-Code,代码行数:11,
示例8: delay_ms/******************************************************************************** PUBLIC FUNCTION: delay_ms** PARAMETERS:* ~ ui_millisecond** RETURN:* ~ void** DESCRIPTIONS:* delay for for period millisecond base on ui_millisecond* based on _XTAL_FREQ value, ui_millisecond range from 0-65,535.*******************************************************************************/void delay_ms(unsigned int ui_millisecond){ for( ; ui_millisecond > 0; ui_millisecond --) { #if (_XTAL_FREQ == 20000000) Delay1KTCYx(5); //5K instruction cycle with 20MHz oscillator is 1ms #elif (_XTAL_FREQ == 48000000) Delay1KTCYx(12); //12K instruction cycle with 48MHz oscillator is 1ms #endif } }
开发者ID:CytronTechnologies,项目名称:ptk40a,代码行数:24,
示例9: delaymsvoid delayms(int x){ if (MNML){ Delay1KTCYx(x); Delay1KTCYx(x); Delay1KTCYx(x); } else{ Delay1KTCYx(x); }}
开发者ID:House-of-Faintree,项目名称:jousting-tournament,代码行数:12,
示例10: sendAccelvoid sendAccel(){ Write1USART(accArr[0]); Delay1KTCYx(4); Write1USART('.'); Delay1KTCYx(4); Write1USART(accArr[1]); Delay1KTCYx(4); Write1USART(accArr[2]); Delay1KTCYx(4); Write1USART('/n');}
开发者ID:jbowen93,项目名称:Portfolio-Code,代码行数:12,
示例11: Init_LCDvoid Init_LCD(void){LCD_CMD(0x02); //Dat che do giao tiep 4-bit, man hinh 2 dongDelay1KTCYx(1);LCD_CMD(0x28); //Tat man hinhDelay1KTCYx(1);LCD_CMD(0x0C); //Che do nhap du lieu binh thuongDelay1KTCYx(1);LCD_CMD(0x06 ); //Bat man hinh, hien con tro nhap nhayDelay1KTCYx(1);//LCD_CMD(0x01); //Xoa man hinhDelay1KTCYx(1);}
开发者ID:TrongkhanhBkhn,项目名称:Project,代码行数:13,
示例12: GPS_rchar GPS_r(void){ unsigned char cs = SPI_CUR_SEL; unsigned char ret; char gval; if(cs == SPI_GPS) { SPI_Device_Select(SPI_MEM); Delay1KTCYx(1); } SPI_Device_Select(SPI_GPS); ret = rw_spi_byte(MAX3100_READ); if(ret & READ_READY) { gval = rw_spi_byte(0); } else gval = 0; if(cs != SPI_GPS) SPI_Device_Select(cs); else SPI_Device_Select(SPI_MEM); return gval; }
开发者ID:seiferteric,项目名称:senior-project-aptt-code,代码行数:25,
示例13: block_on_To_msgqueues// only called from "main"void block_on_To_msgqueues(){ if (!in_main()) { return; } //LATBbits.LATB3 = 1; MQ_Main_Willing_to_block = 1; while (1) { if (check_msg(&ToMainHigh_MQ)) { MQ_Main_Willing_to_block = 0; //LATBbits.LATB3 = 0; return; } if (check_msg(&ToMainLow_MQ)) { MQ_Main_Willing_to_block = 0; //LATBbits.LATB3 = 0; return; } if (check_msg(&adReadQueue)) { MQ_Main_Willing_to_block = 0; //LATBbits.LATB3 = 0; return; } Delay1KTCYx(10); //LATBbits.LATB3 = !LATBbits.LATB3; }}
开发者ID:TackticalDude,项目名称:embeddedgroup5,代码行数:29,
示例14: main//main functionvoid main(void){ unsigned char st1[]="STARTING"; unsigned char st2[]="."; //pins for drive LCD TRISB = 0x80; //Initialize modules Init_LCD(); i2c_config(); set_ds1307_time(AM,0,0,6); set_ds1307_day(8,11,8,13); lcd_putstr(st1); for(i=0;i<7;i++) { lcd_putstr(st2); Delay1KTCYx(200); } LCD_CMD(LCD_clear); while(1) { lcd_gotoxy(1,1);//hang 1, cot 1. Display_time(get_ds1307_time()); lcd_gotoxy(1,2);//hang 2, cot 1 Display_day(get_ds1307_day()); Delay10KTCYx(70); };}
开发者ID:WSAN-Lab411,项目名称:PIC_Programming_Tutorial,代码行数:36,
示例15: mainvoid main (void){ OSCCON = 0x60; // IRCFx = 110 OSCTUNEbits.PLLEN = 0; // x4 PLL disabled // Port D used for diagnostic LEDs TRISD = 0b00111111; // PORTD bit 7 to output (0) ; bits 6:0 are inputs (1) LATDbits.LATD7 = 0; // RED LED LATDbits.LATD6 = 0; // YLW LED // Setup MSSP in 7 bit I2C Slave mode TRISC = 0b00011000; // TRISC 3&4 (SCL & SDA) inputs LATC = 0b00011000; SSPADD = I2C_ADDR; // Set I2C address SSPCON1 = 0x36; // SSPEN: Synchronous Serial Port Enable bit - Enables the serial port and configures the SDA and SCL pins as the serial port pins // CKP: SCK Release Control bit - Release clock // SSPM3:SSPM0: SSP Mode Select bits - 0110 = I2C Slave mode, 7-bit address SSPSTAT = 0x00; SSPCON2 = 0x01; // GCEN: General Call address (00h) (Slave mode only) 0 = General call address disabled // SEN: Start Condition Enable/Stretch Enable bit(1) ()Slave mode) 1 = Clock stretching is enabled PIR1bits.SSPIF = 0; // Clear MSSP interrupt request flag PIE1bits.SSPIE = 1; // Enable MSSP interrupt enable bit INTCONbits.GIE_GIEH = 1; // GIE/GIEH: Global Interrupt Enable bit INTCONbits.PEIE_GIEL = 1; // PEIE/GIEL: Peripheral Interrupt Enable bit while (1) { Delay1KTCYx(50); // Delay 50 x 1000 = 50,000 cycles; 200ms @ 1MHz } }
开发者ID:harrybraviner,项目名称:I2C_slave_example,代码行数:30,
示例16: mainvoid main(void){ //timer vars int result; float final_result; Delay100TCYx(10); //let the device startup usart_init(); i2c_init(); printf("Starting/r/n"); // let sonar initialize, delay 250 ms Delay1KTCYx(625); TRISBbits.TRISB3 = 1; // data pin input while(1) { while(PORTBbits.RB3 == 0); // configure timer0 OpenTimer0(TIMER_INT_OFF & T0_16BIT & T0_SOURCE_INT & T0_PS_1_1); WriteTimer0( 0 ); // restart timer while(PORTBbits.RB3 == 1); //Delay1TCY(); result = ReadTimer0(); // read timer printf("Timer is %u /r/n", result); final_result = (float)result / (float)(2.5*147); printf("X / (4*147) = %i /r/n", (int)final_result); } }
开发者ID:sbobovyc,项目名称:uav_p18f87k22,代码行数:32,
示例17: R_EEPROM/****************************************************************************** * R_EEPROM subroutine * * This routine will read the last set of data from EEPROM and save that data * into holding registers in RAM for tranmission across USART. * * Inputs: addr = EEPROM memory address for pulling data from * mem = RAM location to write data to * Outputs: None ******************************************************************************/void R_EEPROM(unsigned short long addr, unsigned char * mem) { unsigned char temp; unsigned char i; unsigned char high; unsigned char med; unsigned char low; high = addr>>16; //High byte of EEPROM memory location med = addr>>8; //Medium byte of EEPROM memory location low = addr; //Low byte of EEPROM memory location EEPROMEnable(); //Pull CS low to write WriteSPI(ReadEEPROM); //Set READ on EEPROM WriteSPI(high); //Send high address to EEPROM WriteSPI(med); //Send medium address to EEPROM WriteSPI(low); //Send low address to EEPROM for (i = 0; i < 30; i++) { temp = WriteSPI(0x00); //Save the data to holding location in RAM mem[i] = temp; } EEPROMDisable(); //Push CS high to deselect EEPROM Delay1KTCYx(1); //Wait for read to finish just in case}
开发者ID:JohnThom212,项目名称:INFERNO,代码行数:35,
示例18: block_on_To_msgqueuesvoid block_on_To_msgqueues() { if (!in_main()) { return; }#ifdef __USE18F2680 LATBbits.LATB3 = 1;#endif MQ_Main_Willing_to_block = 1; while (1) { if (check_msg(&ToMainHigh_MQ)) { MQ_Main_Willing_to_block = 0;#ifdef __USE18F2680 LATBbits.LATB3 = 0;#endif return; } if (check_msg(&ToMainLow_MQ)) { MQ_Main_Willing_to_block = 0;#ifdef __USE18F2680 LATBbits.LATB3 = 0;#endif return; } Delay1KTCYx(10);#ifdef __USE18F2680 LATBbits.LATB3 = !LATBbits.LATB3;#endif }}
开发者ID:DRpandey,项目名称:PicRouter2-master,代码行数:29,
示例19: Open_nRF24L01_SPIvoid Open_nRF24L01_SPI (void){ unsigned char result; SPI_CSN_TRIS = 0; SPI_CE_TRIS = 0; SPI_IRQ_TRIS = 1; SPI_SO_TRIS = 0; SPI_SCK_TRIS = 0; SPI_CE = 1; SPI_CSN = 1; OpenSPI(SPI_FOSC_4, MODE_00, SMPMID); //open SPI1 Delay1KTCYx(3); result = Test_SPI(); if (result) { LED_ON while (1); // se retornou 1 é porque tem falha comunica C++ DelayInit函数代码示例 C++ Delay10KTCYx函数代码示例
|