当前位置: 首页>>代码示例>>C++>>正文


C++ output_high函数代码示例

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


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

示例1: LEDTest4

void LEDTest4()
{
   int I_B, I_B2, value;
   
   for(I_B2 = 0; I_B2 < 2; I_B2++){
      value = 1;
      for (I_B = 0; I_B < 8; I_B++){
         if (I_B % 2 == 0){
            Portout(value, 0);
            output_low (Ledb_p);
            output_high (Ledm_p);
            output_high (Ledt_p);
            delay_ms (200);
         }
         else{
            Portout(0, value);
            output_high (Ledb_p);
            output_high (Ledm_p);
            output_low (Ledt_p);
            delay_ms (200);
         }
         value = (value*2) + 1;
      }
   }
}
开发者ID:BlacKRoxX,项目名称:Trinity-Software,代码行数:25,代码来源:PIC18F45K22_V0_6_5.c

示例2: LEDTest5

void LEDTest5()
{
   int I_B, I_B2, top, bottom;
   for(I_B2 = 0; I_B2 < 2; I_B2++){
      top = 192;
      bottom = 3;
      for (I_B = 0; I_B < 6; I_B++){
         if (I_B % 2 == 0){
            Portout(top, bottom);
            output_low (Ledb_p);
            output_low (Ledm_p);
            output_low (Ledt_p);
            delay_ms (200);
         }
         else{
            Portout(bottom, top);
            output_high (Ledb_p);
            output_high (Ledm_p);
            output_high (Ledt_p);
            delay_ms (200);
         }
         top = top/2;
         bottom = bottom *2;
      }
   }
}
开发者ID:BlacKRoxX,项目名称:Trinity-Software,代码行数:26,代码来源:PIC18F45K22_V0_6_5.c

示例3: unlock_door

void unlock_door(int rotation)
{
  int i = 0;
  for (i = 0; i < rotation; i++) {
    // Blue Wire + high for 15 milliseconds
    output_high(PORTC,STEPPER4);
    _delay_ms(200);
    //_delay_ms(3000);
    output_low(PORTC,STEPPER4);
    // Green Wire + high fo 15 milliseconds
    output_high(PORTC,STEPPER3);
    _delay_ms(200);
    //_delay_ms(3000);
    output_low(PORTC,STEPPER3);
    // Red Wire + high for 15 milliseconds
    output_high(PORTC,STEPPER2);
    _delay_ms(200);
    //_delay_ms(3000);
    output_low(PORTC,STEPPER2);
    // Black Wire + high for 15 milliseconds
    output_high(PORTC,STEPPER1);
    _delay_ms(200);
    //_delay_ms(3000);
    output_low(PORTC,STEPPER1);
  }
  output_low(PORTB, LED_RED);  // RED LED indicates unlocked
}
开发者ID:cverbitzki,项目名称:SeniorProject,代码行数:27,代码来源:Control_Motor.c

示例4: init_dac

void init_dac()
{
    output_high(DAC_CS);
    output_high(DAC_LDAC);
    output_high(DAC_CLK);
    output_high(DAC_DI);
}
开发者ID:Bellspringsteen,项目名称:Hybrid,代码行数:7,代码来源:mcp4921.c

示例5: lcd_le_byte

byte lcd_le_byte()
// lê um byte do LCD (somente com pino RW)
{
   byte dado;
   // configura os pinos de dados como entradas
   input(lcd_d4);
   input(lcd_d5);
   input(lcd_d6);
   input(lcd_d7);
   // se o pino rw for utilizado, coloca em 1
   #ifdef lcd_rw
      output_high(lcd_rw);
   #endif
   output_high(lcd_enable); // habilita display
   dado = 0;   // zera a variável de leitura
   // lê os quatro bits mais significativos
   if (input(lcd_d7)) bit_set(dado,7);
   if (input(lcd_d6)) bit_set(dado,6);
   if (input(lcd_d5)) bit_set(dado,5);
   if (input(lcd_d4)) bit_set(dado,4);
   // dá um pulso na linha enable
   output_low(lcd_enable);
   output_high(lcd_enable);
   // lê os quatro bits menos significativos
   if (input(lcd_d7)) bit_set(dado,3);
   if (input(lcd_d6)) bit_set(dado,2);
   if (input(lcd_d5)) bit_set(dado,1);
   if (input(lcd_d4)) bit_set(dado,0);
   output_low(lcd_enable);   // desabilita o display
   return dado;   // retorna o byte lido
}
开发者ID:Sel2016,项目名称:microchip,代码行数:31,代码来源:LCD_4B.c

示例6: in_read_charlieplex_inputs

int8 in_read_charlieplex_inputs()
{
	int8 switches;

	output_drive(PI_CHARLIEPLEX_SWITCH_1_PIN);
	switches = input_state(PI_CHARLIEPLEX_SWITCH_3_PIN);
	switches <<= 1;
	switches |= input_state(PI_CHARLIEPLEX_SWITCH_2_PIN);
	output_high(PI_CHARLIEPLEX_SWITCH_1_PIN);
	output_float(PI_CHARLIEPLEX_SWITCH_1_PIN);
	output_low(PI_CHARLIEPLEX_SWITCH_1_PIN);

	output_drive(PI_CHARLIEPLEX_SWITCH_2_PIN);
	switches <<= 1;
	switches |= input_state(PI_CHARLIEPLEX_SWITCH_3_PIN);	
	switches <<= 1;
	switches |= input_state(PI_CHARLIEPLEX_SWITCH_1_PIN);
	output_high(PI_CHARLIEPLEX_SWITCH_2_PIN);
	output_float(PI_CHARLIEPLEX_SWITCH_2_PIN);
	output_low(PI_CHARLIEPLEX_SWITCH_2_PIN);

	//Note: In this block charliplex1 must be read before charliplex2
	// just to charliplex2 has enough time to recover because charliplex2 was 
	// low in previous block. This avoid to put a delay here.
	output_drive(PI_CHARLIEPLEX_SWITCH_3_PIN);
	switches <<= 1;
	switches |= input_state(PI_CHARLIEPLEX_SWITCH_1_PIN);
	switches <<= 1;
	switches |= input_state(PI_CHARLIEPLEX_SWITCH_2_PIN);
	output_high(PI_CHARLIEPLEX_SWITCH_3_PIN);
	output_float(PI_CHARLIEPLEX_SWITCH_3_PIN);
	output_low(PI_CHARLIEPLEX_SWITCH_3_PIN);

	return ~switches;
}
开发者ID:anorimaki,项目名称:pi-metal-detector,代码行数:35,代码来源:input.c

示例7: set_pot

set_pot (int pot_num, int new_value) {
   byte i;
   byte cmd[3];

   if (pot_num >= NUM_POTS)
      return;

   pots[pot_num] = new_value;

   cmd[0]=pots[0];
   cmd[1]=pots[1];
   cmd[2]=0;

   for(i=1;i<=7;i++)
     shift_left(cmd,3,0);

   output_high(RST1);
   delay_us(2);

   for(i=1;i<=17;i++) {
      output_bit(DI, shift_left(cmd,3,0));
      delay_us(2);
      output_high(CLK);
      delay_us(2);
      if(i==17)
         output_low(RST1);
      output_low(CLK);
      delay_us(2);
   }
}
开发者ID:carriercomm,项目名称:robots,代码行数:30,代码来源:DS1868.C

示例8: LCD_Initialization

void LCD_Initialization()
{
	output_low(LCD_CE);
	output_low(LCD_RS);
	output_low(LCD_RW);

	output_d(0);
	output_d(0x38);

	output_high(LCD_CE);
	Nop();
	Nop();
	output_low(LCD_CE);

	delay_ms(20);

	output_d(0x38);

	output_high(LCD_CE);
	Nop();
	Nop();
	output_low(LCD_CE);

	delay_ms(5);

	LCD_Cmd(DISPLAY_ON);		// display on, curse off, blink off
	LCD_Cmd(0x01);				// display on, curse off, blink off
	LCD_Cmd(0x06);				// LCD clear, curse home
	LCD_Cmd(0x80);				// initial DDRAM address
	LCD_Cmd(0x01);				// LCD clear,curse home
}
开发者ID:eunwho,项目名称:lcdConverter,代码行数:31,代码来源:LCD.C

示例9: write_dac

void write_dac(int16 data) {
    BYTE cmd[3];
    BYTE i;

    cmd[0]=data;
    cmd[1]=(data>>8);
    cmd[2]=0x03;

    output_high(DAC_LDAC);
    output_low(DAC_CLK);
    output_low(DAC_CS);

    for(i=0; i<=23; ++i)
    {
        if(i<4 || (i>7 && i<12))
            shift_left(cmd,3,0);
        else
        {
            output_bit(DAC_DI, shift_left(cmd,3,0));

            output_high(DAC_CLK);
            output_low(DAC_CLK);
        }
    }
    output_high(DAC_CS);

    output_low(DAC_LDAC);
    delay_us(10);

    output_HIGH(DAC_LDAC);
}
开发者ID:Bellspringsteen,项目名称:Hybrid,代码行数:31,代码来源:mcp4921.c

示例10: WRITE_EXT_SRAM_STRING

void WRITE_EXT_SRAM_STRING(byte Address, char* ptrData)
{
   byte Cnt,Data;

   EnableSRAM(TRUE);

   // Send Write Address       // write: bit 7 = 1
   Data = 0x80;               // other bits are address
   Data |= Address;
   EnableSRAM(TRUE);
   for(Cnt = 8; Cnt > 0; Cnt--)
   {
      output_bit(SRAM_MOSI,bit_test(Data,(Cnt - 1)));
      output_high(SRAM_SCK);
      output_low(SRAM_SCK);
   }

   // Write ptrData to SRAM
   Data = *ptrData;
   while(Data != 0)
   {
      for(Cnt = 8; Cnt > 0; Cnt--)     // shift in bits 7 - 0
      {
         output_bit(SRAM_MOSI,bit_test(Data,(Cnt - 1)));
         output_high(SRAM_SCK);
         output_low(SRAM_SCK);
      }
      ++ptrData;
      Data = *ptrData;
   }

   EnableSRAM(FALSE);
}
开发者ID:carriercomm,项目名称:robots,代码行数:33,代码来源:68HC68R1.C

示例11: main

void main()
{

   setup_oscillator(OSC_NORMAL);


while (true)
{
   output_A(0xff);
   output_B(0xff);
   output_C(0xff);
   output_D(0xff);
   output_E(0xff);
   output_high(pin_C1);
   output_high(pin_C0);
   output_high(pin_A4);
   
   Delay_ms(500);
   output_A(0x0);
   output_B(0x0);
   output_C(0x0);
   output_D(0x0);
   output_E(0x0);
   output_low(pin_C1);
   output_low(pin_C0);
   output_low(pin_A4);
   Delay_ms(500);
}



}
开发者ID:yasuravithana,项目名称:PassTune_Hardware,代码行数:32,代码来源:test+with+internal+clock.c

示例12: send_8bit_serial_data

// transmit byte serially, MSB first
void send_8bit_serial_data(unsigned char data)
{
  unsigned char i;

  // select device
  output_high(SD_CS); //Basically does chip enable

  // send bits 7..0
  for(i = 0; i < 8; i++) //Only for 8bits
    {
      // consider leftmost bit
      // set line high if bit is 1, low if bit is 0
      if (data & 0x80) //It's start in the eighs bith
        output_high(SD_DI);
      else
        output_low(SD_DI);

      // pulse clock to indicate that bit value should be read
      output_low(SD_CLK);
      output_high(SD_CLK);

      // shift byte left so next bit will be leftmost
      data <<= 1;
    }

  // deselect device
  output_low(SD_CS);
}
开发者ID:cnm,项目名称:mia_vita,代码行数:29,代码来源:bitbang.c

示例13: RTCC_isr

void RTCC_isr() //function interrupción TMR0
   {  set_TIMER0(5); //inicializa el timer0 para que cuente 0.2 us 
   output_toggle(PIN_B2);
   set_TIMER0(5); //inicializa el timer0 para que cuente 0.2 us
   cont++;
   //Giro en un sentido
   if(input(PIN_B0)==1){
      if ((int16)cont==(int16)10){ cont=0;
            output_high(PIN_B3);}
      if((int16)comp1==(int16)cont){
            output_low(PIN_B3);}
   }
   if (input(PIN_B0)==0)
   output_low(PIN_B3);
    //--------------Giro opuesto----------------
       if(input(PIN_B1)==1){
      if ((int16)cont==(int16)10){ cont=0;
            output_high(PIN_B4);}
      if((int16)comp1==(int16)cont){
            output_low(PIN_B4);}
   }
   if (input(PIN_B1)==0)
   output_low(PIN_B4);
    
   }
开发者ID:JOTAI,项目名称:SistemasEmbebidos2014-I,代码行数:25,代码来源:PWM_Timer.c

示例14: LEDTest2

void LEDTest2()
{
   int I_B, li, re;

   
   for(I_B = 0; I_B < 3; I_B++){
      output_low (Ledb_p);
      output_low (Ledm_p);
      output_low (Ledt_p);
      
      /*
         255 = 1111 1111
         127 = 0111 1111
          85 = 0101 0101
         170 = 1010 1010
      */
     
      li = 170;
      re = 85;
      
      Portout(li, re);
      delay_ms (200);
      
      output_high (Ledb_p);
      output_high (Ledm_p);
      output_high (Ledt_p);
      
      li = 85;
      re = 170;
      
      Portout(li, re);
      delay_ms (200);
   }
}
开发者ID:BlacKRoxX,项目名称:Trinity-Software,代码行数:34,代码来源:PIC18F45K22_V0_6.c

示例15: LEDTest3

void LEDTest3()
{
   int I_B, li, re;
   
   for(I_B = 0; I_B < 2; I_B++){
      output_low (Ledb_p);
      output_high (Ledm_p);
      output_low (Ledt_p);
      
      li = 1;
      re = 1;
      
      for (I_B = 0; I_B < 8; I_B++){
         Portout(li, re);
         delay_ms (200);
         li = (li * 2) + 1 ;
         re = (re * 2) + 1 ;
      }
      
      output_high (Ledb_p);
      output_low (Ledm_p);
      output_high (Ledt_p);
      
      
      for (I_B = 0; I_B < 8; I_B++){
         Portout(li, re);
         delay_ms (200);
         li = (int)(li / 2);
         re = (int)(re / 2);
      }
   
   }    
}
开发者ID:BlacKRoxX,项目名称:Trinity-Software,代码行数:33,代码来源:PIC18F45K22_V0_7.c


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