• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ output_high函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: init_ADNS2051

//-----------------------------------------------------------------------
//	init_ADNS2051()
//-----------------------------------------------------------------------
//
void init_ADNS2051() {
int i;	

// Initialisation
	setup_timer_1(T1_INTERNAL | T1_DIV_BY_8);

	posX = 0;
	posY = 0;

	DeltaX = 0;
	DeltaY = 0;

	teller = 0;
	teller1 = 0;

	for(i=0;i<DELTA_LOG_SIZE;i++){
		lastX[i] = 0;
		lastY[i] = 0;
	}

// Init ADNS-2051 pins
	output_high(SDIO);
	output_high(SCLK);
	output_low(PD);	
	delay_ms(2);

// Resync 
	output_high(PD);
	delay_ms(2);
	output_low(PD);
}
开发者ID:carriercomm,项目名称:robots,代码行数:35,代码来源:ADNS2051.c


示例17: main

int main(void) {
  // initialize the direction of PORTD #6 to be an output
  set_output(DDRC, LED1);  
  set_output(DDRC, LED2);
  set_output(DDRC, LED3);
  set_output(DDRD, LED4);

  while (1) {
    output_high(PORTC, LED1);
    delay_ms(200);
    output_high(PORTC, LED2);
    delay_ms(200);
    output_high(PORTC, LED3);
    delay_ms(200);
    output_high(PORTD, LED4);
    delay_ms(200);

    output_low(PORTC, LED1);
    delay_ms(200);
    output_low(PORTC, LED2);
    delay_ms(200);
    output_low(PORTC, LED3);
    delay_ms(200);
    output_low(PORTD, LED4);
    delay_ms(200);
  }
}
开发者ID:markbradley27,项目名称:POVbee,代码行数:27,代码来源:BlinkTest.c


示例18: READ_EXT_SRAM

byte READ_EXT_SRAM(byte Address)
{
   byte Cnt,Data;

   EnableSRAM(TRUE);

   // Send Read Address       // write: bit 7 = 0
   Data = 0;                  // 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);
   }

   // Read each bit from address
   Data = 0;
   for(Cnt = 8; Cnt > 0; Cnt--)     // shift in bits 7 - 0
   {
      output_high(SRAM_SCK);
      output_low(SRAM_SCK);
      if(input(SRAM_MISO))
         bit_set(Data,(Cnt - 1));
   }
   EnableSRAM(FALSE);
   return(Data);
}
开发者ID:carriercomm,项目名称:robots,代码行数:29,代码来源:68HC68R1.C


示例19: WRITE_EXT_SRAM

void WRITE_EXT_SRAM(byte Address, byte DataIn)
{
   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 DataIn to SRAM
   for(Cnt = 8; Cnt > 0; Cnt--)     // shift in bits 7 - 0
   {
      output_bit(SRAM_MOSI,bit_test(DataIn,(Cnt - 1)));
      output_high(SRAM_SCK);
      output_low(SRAM_SCK);
   }
   EnableSRAM(FALSE);
}
开发者ID:carriercomm,项目名称:robots,代码行数:26,代码来源:68HC68R1.C


示例20: main

void main()
{

   setup_adc_ports(ALL_ANALOG);
   setup_adc(ADC_CLOCK_INTERNAL);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);

   // TODO: USER CODE!!
   
      set_adc_channel(0);            // set ref valus
      delay_ms(100);
      ref_0 =read_adc();
      delay_ms(100);
      
      set_adc_channel(3);            // set ref valus
      delay_ms(100);
      ref_3 =read_adc();
      delay_ms(100);
   
   output_b(0b11111111);
   delay_ms(700);
   output_b(0);
   
   while(1){
      set_adc_channel(0);
      delay_ms(20);                        // take readings
      adc_val_0 =read_adc();
      delay_ms(20);
      if(adc_val_0 > ref_0+cons){
         l_0 =1;
         output_high(pin_d7);
         delay_ms(500);
      }
      else{
         l_0=0;
         output_low(pin_d7);
     //    delay_ms(500);
      }
      
      set_adc_channel(3);
      delay_ms(20);                        // take readings
      adc_val_3 =read_adc();
      delay_ms(20);
      if(adc_val_3> ref_3+cons){
         l_3 =1;
         output_high(pin_d6);
         delay_ms(500);
      }
      else{
         l_3=0;
         output_low(pin_d6);
      }
   }
}
开发者ID:isurusanjeewa,项目名称:Line-Following-Robot,代码行数:60,代码来源:2_sen.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ output_init函数代码示例发布时间:2022-05-30
下一篇:
C++ output_data函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap