本文整理匯總了C++中Delay10KTCYx函數的典型用法代碼示例。如果您正苦於以下問題:C++ Delay10KTCYx函數的具體用法?C++ Delay10KTCYx怎麽用?C++ Delay10KTCYx使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Delay10KTCYx函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: main
void main()
{
Initial(); //Initialize all settings required for general QwikFlash and LCD operation
DisplayC(Clear1); //Clear the LCD one time at the beginning of your program
DisplayC(Clear2);
long retTen; // initialize variable for 10K ohm potentiometer
long retPot; // initialize variable for Potentiometer 1 on circuit board
SSPSTAT = 0b11000000; // SMP and CKE
SSPCON1 = 0b00100000; // Enable SPI serial port
//Your personal PORT/TRIS/ADCON/etc settings or configurations can go here
//Or make your own function and call it
while(1)
{
Delay10KTCYx(25);
retTen = tenK(); // Store value from 10K ohm potentiometer
Delay10KTCYx(25);
retPot = pot1(); // Store value from Potentiometer 1 on circuit board
displayAnalog(retTen, retPot);
}
}
示例2: interruptions_left
void interruptions_left(void) //for interruptions appearing on the left to the track
{
straight_fwd(); // Go forward
Delay10KTCYx(130);
check_sensors();
if (SeeLine.b.Left&&!SeeLine.b.CntLeft&&SeeLine.b.Center&&!SeeLine.b.CntRight&&!SeeLine.b.Right) //10100
{
while(SeeLine.b.Left&&!SeeLine.b.CntLeft&&SeeLine.b.Center&&!SeeLine.b.CntRight&&!SeeLine.b.Right)//00000 sees nothing
{ //spin right
spin_right();
check_sensors();
}
}
else if (!SeeLine.b.Left&&!SeeLine.b.CntLeft&&SeeLine.b.Center&&!SeeLine.b.CntRight&&SeeLine.b.Right) //00101
{
straight_fwd(); // Go forward
Delay10KTCYx(130);
check_sensors();
if (!SeeLine.b.Left&&!SeeLine.b.CntLeft&&!SeeLine.b.Center&&!SeeLine.b.CntRight&&!SeeLine.b.Right) //00000
{
while(!SeeLine.b.Left&&!SeeLine.b.CntLeft&&!SeeLine.b.Center&&!SeeLine.b.CntRight&&!SeeLine.b.Right) //00000
{
spin_right();
check_sensors();
}
}
}
*
}
示例3: pirIndicate
// LED indication for PIR true
void pirIndicate(void)
{
LED = 1;
Delay10KTCYx(20);
LED = 0;
Delay10KTCYx(20);
}
示例4: initialize
void initialize() ///Works with current delays
{
int result;
result = enterCommandMode();
sendString(GET_WLAN_STRING, 6);
Delay10KTCYx(0);
sendString(SET_SSID, 18);
Delay10KTCYx(0);
sendString(SET_PASSPHRASE, 29);
Delay10KTCYx(0);
sendString(SET_CHANNEL, 10);
Delay10KTCYx(0);
sendString(SET_AUTH, 10);
Delay10KTCYx(0);
sendString(SET_JOIN, 10);
Delay10KTCYx(0);
sendString(SET_DHCP, 10);
Delay10KTCYx(0);
sendString(SET_COMM_OPEN, 10);
Delay10KTCYx(0);
sendString(SET_COMM_REMOTE, 10);
Delay10KTCYx(0);
autoConnect();
sendString(SAVE, 5);
Delay10KTCYx(0);
result = rebootModule();
longDelay();
}
示例5: botao
int botao()
{
if (botao1==0)
{
Delay10KTCYx(10);
if (botao1==0)
return 1;
}
else if (botao2==0)
{
Delay10KTCYx(10);
if (botao2==0)
return 2;
}
else if (botao3==0)
{
Delay10KTCYx(10);
if (botao1==0)
return 3;
}
else if (botao4==0)
{
Delay10KTCYx(10);
if (botao4==0)
return 4;
}
else
return 0;
}
示例6: main
void main(void) {
ConfigureOscillator();
TRISB0 = 0;
TRISB1 = 0;
TRISB4 = 1;
TRISA1 = 1;
//unsigned char channel = 0x00, config1 = 0x00, config2 = 0x00, config3 = 0x00, portconfig = 0x00, i = 0;
//CloseADC();
//config1 = ADC_FOSC_2 | ADC_RIGHT_JUST | ADC_2_TAD;
//config2 = ADC_CH0 | ADC_INT_OFF | ADC_REF_VDD_VSS;
//portconfig = ADC_4ANA;
//OpenADC(config1, config2, portconfig);
/*
ADCON0bits.ADON = 0b1;
ADCON0bits.CHS = 0b00;
ADCON1bits.VCFG0 = 0b0;
ADCON1bits.PCFG0 = 0b1;
ADCON2bits.ADFM = 0b1;
ADCON2bits.ADCS = 0b000;
*/
//ADC_INT_ENABLE();
while(1){
//ConvertADC();
//while (BusyADC());
//ADCResult = PORTAbits.RA1;//(unsigned int) ReadADC();
// if(ADCResult==1){
LATB0 = 1; // RB-0 to High
LATB1 = 1; // RB-1 to High
Delay10KTCYx(30);
// }else{
LATB0 = 0; // RB-0 to High
LATB1 = 0; // RB-1 to High
//}
Delay10KTCYx(30);
}
/*
while (1) {
//PORTBbits.RB1=0b1
//if(PORTBbits.RB4==0){
LATBbits.LATB0 = 1; // RB-0 to High
LATBbits.LATB1 = 0; // RB-1 to High
//delays(1);
Delay10KTCYx(30);
// }
// if(PORTBbits.RB4==1){
LATBbits.LATB0 = 0; // RB-0 to LOW
LATBbits.LATB1 = 1; // RB-1 to LOW
//delays(1);
Delay10KTCYx(30);
// }
}*/
}
示例7: delay_1Sx
void delay_1Sx(int n){
for(int i =0; i<n; i++){
Delay10KTCYx(250); // Delay 2,500,000 Cycles = 0.25 seconds
Delay10KTCYx(250); // Delay 2,500,000 Cycles = 0.25 seconds
Delay10KTCYx(250); // Delay 2,500,000 Cycles = 0.25 seconds
Delay10KTCYx(250); // Delay 2,500,000 Cycles = 0.25 seconds
}
}
示例8: main
void main(void) {
unsigned char slave7bitAddr = 0x2A; //7-bit address of Slave. MSB=Don't care.
unsigned char slaveAddrWrite = (slave7bitAddr << 1); //LSB=0, Master Write request.
signed char writeStat;
unsigned char message[11] = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd'};
OSCCONbits.IRCF = 0b111; //Set internal oscillator to 16mHz
//Must set SCL(pin RC3)and SDA(pin RC4) as inputs and enable digital buffers.
TRISCbits.TRISC3 = 1; //set input
TRISCbits.TRISC4 = 1;
ANSELCbits.ANSC3 = 0; //enable digital buffer
ANSELCbits.ANSC4 = 0;
OpenI2C1(MASTER, SLEW_OFF); //If you switch to 400kHz (see below) set SLEW_ON
/* You can ignore all I2C "unable to resolve identifier" errors assuming
you didn't make any typos. Don't forget the "1"'s. */
/* Now set the I2C clock speed. I2C Master always controls clock.
For 400kHz use 1k pullup resistors and for 100kHz use 2.2k ohms */
SSP1ADD = 0x27; //100Khz = FOSC/(4 * (SSPADD + 1)) = 16E6/((39 + 1) * 4)note:39=0x27
//SSP1ADD = 0x09; //400Khz = FOSC/(4 * (SSPADD + 1)) = 16E6/((9 + 1) * 4)
while (1) {
IdleI2C1(); //Wait for bus to become idle.
StartI2C1(); //Begin I2C communication
IdleI2C1();
//send slave address (w/write request bit) and wait for slave to reply.
do {
writeStat = WriteI2C1(slaveAddrWrite); //Send address with LSB=Write
if (writeStat == -1) { //Detected bus collision - More than one master?
unsigned char data = SSP1BUF; //clear the buffer by reading it.
SSPCON1bits.WCOL = 0; //clear the bus collision status bit
} else if (writeStat == -2) { //NACK (no acknowledge rx'd)
//Is the slave on and ready? Did we send the correct address?
}
} while (writeStat != 0); //Keep repeating until slave acknowledges.
//Slave has Ack'd so we can send our Hello World message now.
for (int x = 0; x <= 10; x++) {
do {
writeStat = (WriteI2C1(message[x]));
if (writeStat == -2) { //NACK (no acknowledge rx'd)
//Is the slave on and ready? Using the correct pullups?
}
} while (writeStat != 0); //Keep repeating until slave acknowledges.
}
IdleI2C1();
StopI2C1();
//Delay about 1 sec and then repeat. 1sec = ((10K*200*2)/(16E6/4)
Delay10KTCYx(200);
Delay10KTCYx(200);
}
}
示例9: main
/*
* MAIN
*/
int main(int argc, char** argv) {
// RA1 as DO
LATA = 0;
ADCON1 = 0x06;
TRISA1 = 0;
LATA1 = 1;
// I2C configuration
i2c_setup();
unsigned char w;
for(w=0;w<20;w++)
I2C_Recv[w]=0;
unsigned int temps = 25;
unsigned char temp, length=0;
while(1){
LATA1 = ~LATA1;
Delay10KTCYx(temps);
check_interruptions();
if (DataRdyI2C()==1) {
temps += 25;
temp = ReadI2C();
//********************* Data reception from master by slave *********************
do {
while(DataRdyI2C()==0); // WAIT UNTILL THE DATA IS TRANSMITTED FROM master
I2C_Recv[length++]=getcI2C(); // save byte received
}
while(length!=20);
}
}
//******************** write sequence from slave *******************************
while(SSPSTATbits.S!=1); //wait untill STOP CONDITION
//********************* Read the address sent by master from buffer **************
while(DataRdyI2C()==0); //WAIT UNTILL THE DATA IS TRANSMITTED FROM master
temp = ReadI2C();
//********************* Slave transmission ************************************
if(SSPSTAT & 0x04) //check if master is ready for reception
while(putsI2C(I2C_Send)); // send the data to master
//-------------TERMINATE COMMUNICATION FROM MASTER SIDE---------------
CloseI2C(); //close I2C module
while(1) {
LATA1 = ~LATA1;
Delay10KTCYx(100);
}; //End of program
return (EXIT_SUCCESS);
}
示例10: msg_inicial
void msg_inicial()
{
printf("Kit de Desenvolvimento ACEPIC 28\r\n");
Delay10KTCYx(1); //Gera um delay de 5ms
printf("Microcontrolador: PIC 18F2550\r\n");
Delay10KTCYx(1); //Gera um delay de 5ms
printf("\r\n-Envie AD0 para retornar Conversao A/D do Canal 0.\r\n");
Delay10KTCYx(1); //Gera um delay de 5ms
printf("-Envie TMP para retornar Conversao A/D do Canal 3. (Temperatura)\r\n\r\n");
}
示例11: eventL
// LED indicator
void eventL(void)
{
LED = 1;
Delay10KTCYx(10);
LED = 0;
Delay10KTCYx(10);
LED = 1;
Delay10KTCYx(10);
LED = 0;
Delay10KTCYx(10);
}
示例12: DelayS
void DelayS(unsigned long seconds)
{
unsigned long count;
for(count = 0; count < seconds; count++)
{
Delay10KTCYx(250);
Delay10KTCYx(250);
Delay10KTCYx(250);
Delay10KTCYx(250);
}
}
示例13: main
void main(void)
{
int count = 0;
char buffer[20];
OSCCON = OSCCON_VALUE; // Sets 16MHz
modemSetup();
aprsMakeCallsignPgm(&(s_packet.to), APRS_ADDRESS_TEST, APRS_DESTINATION_SSID_NONE);
aprsMakeCallsignPgm(&(s_packet.from), "M0RJC", 9);
aprsSetLastAddress(&(s_packet.from));
while(1)
{
modemTxMode();
modemStartTone(0);
Delay10KTCYx(0); // 2,560,000 cycles * 4MHz
modemStartTone(1);
Delay10KTCYx(0); // 2,560,000 cycles * 4MHz
strcpypgm2ram(s_packet.message, ">Test Message from M0RJC tracker project");
aprsSendPacket(&s_packet);
Delay10KTCYx(0); // 2,560,000 cycles * 4MHz
Delay10KTCYx(0); // 2,560,000 cycles * 4MHz
Delay10KTCYx(0); // 2,560,000 cycles * 4MHz
strcpypgm2ram(s_packet.message, ":M0RJC :If you can read this it works. ");
itoa(count++, buffer);
strcat(s_packet.message, buffer);
aprsSendPacket(&s_packet);
Delay10KTCYx(0); // 2,560,000 cycles * 4MHz
Delay10KTCYx(0); // 2,560,000 cycles * 4MHz
Delay10KTCYx(0); // 2,560,000 cycles * 4MHz
strcpypgm2ram(s_packet.message, ":M0RJC :Message Again. ");
itoa(count++, buffer);
strcat(s_packet.message, buffer);
aprsSendPacket(&s_packet);
modemRxMode();
Delay10KTCYx(0); // 2,560,000 cycles * 4MHz
Delay10KTCYx(0); // 2,560,000 cycles * 4MHz
}
}
示例14: tracking_profondeur
void tracking_profondeur(int vitesse) {
int i = 0 ;
Sens_Profondeur = !sens_rotation_profondeur ;
Enable_Profondeur = 1 ;
for(i=0;i<nb_pas_profondeur;i++) {
Clock_Profondeur = 0;
Delay10KTCYx(vitesse);
Clock_Profondeur = 1;
Delay10KTCYx(vitesse);
if (sens_rotation_profondeur==SENS_HOR) position_moteur_profondeur ++ ;
else if (sens_rotation_profondeur==SENS_TRIGO) position_moteur_profondeur -- ;
}
}
示例15: tracking_azimut
void tracking_azimut(int vitesse) {
int i = 0 ;
Sens_Azimut = sens_rotation_azimut ;
Enable_Azimut = 1 ;
for(i=0;i<nb_pas_azimut;i++) {
Clock_Azimut = 0;
Delay10KTCYx(vitesse);
Clock_Azimut = 1;
Delay10KTCYx(vitesse);
if (sens_rotation_azimut==SENS_HOR) position_moteur_azimut ++ ;
else if (sens_rotation_azimut==SENS_TRIGO) position_moteur_azimut -- ;
}
}