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

C++ shiftOut函数代码示例

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

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



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

示例1: digitalWrite

uint8_t sensirion::sendCommandSHT(uint8_t _command, int _dataPin, int _clockPin)
{
	if (sendCommandSHT_internal(_command, _dataPin, _clockPin) != 0){
	  // no ack, reset the interface and retry ONE time
	  digitalWrite(_dataPin, HIGH);
	  digitalWrite(_clockPin, LOW);
	  pinMode(_dataPin, OUTPUT);
	  pinMode(_clockPin, OUTPUT);
	  digitalWrite(_dataPin, HIGH);
	  digitalWrite(_clockPin, LOW);

	  shtDelay(1);
	  // send >9 clocks to reset interface
	  shiftOut(_dataPin, _clockPin, MSBFIRST, 0xff, SHT_NOACK);
	  shtDelay(1);
	  shiftOut(_dataPin, _clockPin, MSBFIRST, 0xff, SHT_NOACK);
	  // if we reset, do a real 1 ms delay
	  delay(1);

	  return sendCommandSHT_internal(_command, _dataPin, _clockPin);
	} else{
	  // success
	  return SHT_SUCCESS;
	}
}
开发者ID:HydroSense,项目名称:sensirion,代码行数:25,代码来源:sensirion.cpp


示例2: digitalWrite

void Multiplex7Seg4Digit::update() {
  if (pclass && pclass->_isNumDefined) {

    if(pclass->_num < 0 || pclass->_num > 9999) return;

    // Crear display. We can't just use clear() method here
    digitalWrite(pclass->_latchPin, LOW);
    shiftOut(pclass->_dataPin, pclass->_clockPin, MSBFIRST , 0b00000000);
    shiftOut(pclass->_dataPin, pclass->_clockPin, MSBFIRST , 0b00000000);
    digitalWrite(pclass->_latchPin, HIGH);

    String numStr = String(pclass->_num);
    
    if(pclass->_num < 10) {
      pclass->displayDecimal(pclass->_num, 3);
    } else if(pclass->_num < 100) {
      pclass->displayDecimal(numStr.charAt(0)-'0', 2);
      pclass->displayDecimal(numStr.charAt(1)-'0', 3);
    } else if(pclass->_num < 1000) {
      pclass->displayDecimal(numStr.charAt(0)-'0', 1);
      pclass->displayDecimal(numStr.charAt(1)-'0', 2);
      pclass->displayDecimal(numStr.charAt(2)-'0', 3);
    } else if(pclass->_num < 10000) {
      pclass->displayDecimal(numStr.charAt(0)-'0', 0);
      pclass->displayDecimal(numStr.charAt(1)-'0', 1);
      pclass->displayDecimal(numStr.charAt(2)-'0', 2);
      pclass->displayDecimal(numStr.charAt(3)-'0', 3);
    }
  }
}
开发者ID:andrey-ushakov,项目名称:Multiplex7Seg4Digit,代码行数:30,代码来源:Multiplex7Seg4Digit.cpp


示例3: digitalWrite

void ShiftLCD::write4bits(uint8_t value, uint8_t mode) {
	int EN_SWITCH = B00000010;
	int RS_SWITCH = B00000001;
	int cmd = 0;
	int data = 0;
	if (!mode) {
		cmd = 0 | _backlight;
	} else {
		cmd = LCD_RS_PIN | _backlight;
	}
    data = value<<4 & B11110000;
	cmd |= EN_SWITCH;
	digitalWrite(_latch_pin, HIGH);
	shiftOut(_data_pin, _clock_pin, LSBFIRST, data | cmd);
	digitalWrite(_latch_pin, LOW);
	delayMicroseconds(1);
	
	cmd &= ~EN_SWITCH;
	digitalWrite(_latch_pin, HIGH);
	shiftOut (_data_pin, _clock_pin, LSBFIRST, data | cmd);
	digitalWrite(_latch_pin, LOW);
	delayMicroseconds(1);
	
	cmd |= EN_SWITCH;
	digitalWrite(_latch_pin, HIGH);
	shiftOut(_data_pin, _clock_pin, LSBFIRST, data | cmd);
	digitalWrite(_latch_pin, LOW);
	
	delayMicroseconds(100);
}
开发者ID:felipehfj,项目名称:Arduino,代码行数:30,代码来源:ShiftLCD.cpp


示例4: shiftOut

void LEDDisplay74HC595::setDisplayByte(byte displayByte, int pos)
{
  shiftOut(_displayIO, _shiftClock, MSBFIRST, ~displayByte);
  shiftOut(_displayIO, _shiftClock, MSBFIRST, POS[pos]);
  digitalWrite(_resetClock, LOW);
  digitalWrite(_resetClock, HIGH);
}
开发者ID:chrizzzzz,项目名称:LEDDisplay74HC595,代码行数:7,代码来源:LEDDisplay74HC595.cpp


示例5: digitalWrite

void LED47::displayDigital( int pos, char letter )
{
    digitalWrite(_rclkPin, LOW);
    shiftOut(_dioPin, _sclkPin, MSBFIRST, getBinCode(letter));
    shiftOut(_dioPin, _sclkPin, MSBFIRST, getPosCode(pos));
    digitalWrite(_rclkPin, HIGH);
}
开发者ID:qhwa,项目名称:led47,代码行数:7,代码来源:LED47.cpp


示例6: digitalWrite

void Visor::loop(){
      //visualizar digitos
      digitalWrite(VISOR_LATCH_PIN, LOW);
      shiftOut(VISOR_DATA_PIN, VISOR_CLOCK_PIN, MSBFIRST, digitos[0].getCifraSegmentByte());
      shiftOut(VISOR_DATA_PIN, VISOR_CLOCK_PIN, MSBFIRST, digitos[1].getCifraSegmentByte());
      digitalWrite(VISOR_LATCH_PIN, HIGH);
}
开发者ID:rcriesgo,项目名称:ejemplos_cpp_arduino,代码行数:7,代码来源:Visor.cpp


示例7: shiftOut

void DSP0801Class::display() {
	for (int i = 0; i < MAX_CURSOR; i++) {
		shiftOut(_MOSI, _CLK, MSBFIRST, highByte(data_array[i]));
		shiftOut(_MOSI, _CLK, MSBFIRST, lowByte(data_array[i]));
	}
	pulseLAT();
}
开发者ID:embeddedadventures,项目名称:DSP-0801,代码行数:7,代码来源:DSP0801.cpp


示例8: digitalWrite

void phi_liudr_keypads::updateShiftRegister(byte first8, byte next8)
{
  digitalWrite(latchPin, LOW);  // Disable update to the output buffers.
  shiftOut(dataPin, clockPin, MSBFIRST, first8);//MSBFIRST when flat LSBFIRST when standing.
  shiftOut(dataPin, clockPin, LSBFIRST, next8);//MSBFIRST when flat LSBFIRST when standing.
  digitalWrite(latchPin, HIGH);  // Enable update to the output buffers.
}
开发者ID:NAzT,项目名称:Arduino-NAzT,代码行数:7,代码来源:phi_interfaces.cpp


示例9: loop

void loop() {


    for (int j = 0; j < 16; j++) {

        digitalWrite(latchPin, 0);

        if (j<8)
        {
            dataGREEN = dataArrayGREEN[j];
            shiftOut(dataPin, clockPin, dataGREEN);
        }

        else
        {
            dataRED = dataArrayRED[j/2];
            shiftOut(dataPin, clockPin, dataRED);
        }



        //return the latch pin high to signal chip that it
        //no longer needs to listen for information
        digitalWrite(latchPin, 1);
        delay(300);
    }
}
开发者ID:glerm,项目名称:rascunhos_arduino,代码行数:27,代码来源:shift_painel_tempo.cpp


示例10: shiftOut

void DdxCtl::turnOff() {
    shiftOut(DATAPIN, CLOCKPIN, MSBFIRST, 0);
    shiftOut(DATAPIN, CLOCKPIN, MSBFIRST, 0);
    shiftOut(DATAPIN, CLOCKPIN, MSBFIRST, 0);

    this->toggleLatch();
}
开发者ID:Ddall,项目名称:DdxScreen,代码行数:7,代码来源:DdxCtl.cpp


示例11: bitWrite

stdReturnType MaxMatrix::setDot(byte Column, byte Row, byte Value)
{
	if(Column >= 0 && Column < MAXMATRIX_NUMBER_OF_COLUMNS && Row >= 0 && Row < MAXMATRIX_ROW_NUMBER_OF_MODULE) {
	    bitWrite(buffer[Column], Row, Value);

	    int Module = Column / MAXMATRIX_COLUMN_NUMBER_OF_MODULE;
	    int ModuleColumn = Column % MAXMATRIX_COLUMN_NUMBER_OF_MODULE;
	    digitalWrite(ChipSelectPin, LOW);
	    for(int i = 0; i < NumberOfModules; i++)
	    {
		    if (i == Module) {
			    shiftOut(DataInPin, ClockPin, MSBFIRST, ModuleColumn + 1);
			    shiftOut(DataInPin, ClockPin, MSBFIRST, buffer[Column]);
			    } else {
			    shiftOut(DataInPin, ClockPin, MSBFIRST, 0);
			    shiftOut(DataInPin, ClockPin, MSBFIRST, 0);
		    }
	    }
	    digitalWrite(ChipSelectPin, LOW);
	    digitalWrite(ChipSelectPin, HIGH);
		return E_OK;
	} else {
		return E_NOT_OK;
	}
}
开发者ID:AndreasBur,项目名称:MaxMatrix,代码行数:25,代码来源:MaxMatrix.cpp


示例12: draw

void draw(int col, int row, int holdtime, int color){
  shiftOut(ROW_DAT,ROW_CLK,MSBFIRST,row);
  shiftOut(color,COL_CLK,MSBFIRST,col);
  delay(holdtime);
  shiftOut(ROW_DAT,ROW_CLK,MSBFIRST,0);
  shiftOut(color,COL_CLK,MSBFIRST,0);
}
开发者ID:infoINI,项目名称:mateLight,代码行数:7,代码来源:matelight.c


示例13: update_display

void update_display(void) {
	digitalWrite(LATCH, LOW);
	shiftOut(DATA, CLOCK, LSBFIRST, 1<<(current_row-Y_OFFSET));
	shiftOut(DATA, CLOCK, LSBFIRST, (display[current][current_row]<<X_OFFSET));
	digitalWrite(LATCH, HIGH);
	current_row = (current_row+1)%RES_Y;
}
开发者ID:wertarbyte,项目名称:arduino-64,代码行数:7,代码来源:display.cpp


示例14: displayPrint

/*
void displayPrint(uint8_t num) {
#ifdef USE_EEPROM

#else
    shiftOut(numbers[num%10]);
#endif
#if (DIGITS_NUMBER > 1)
    uint8_t a;
    //SEG_0= 1;
    SEG_PORT|= seg[0];
    for (uint8_t i = 20; i > 0; i--) {
        asm("nop\n");
    }
            if(num/=10) {
                a= num%10;
                //SEG_0= 0;
                SEG_PORT&= ~seg[0];
#ifdef USE_EEPROM

#else
                shiftOut(numbers[a]);
#endif
                //SEG_1= 1;
                SEG_PORT|= seg[1];
                for (uint8_t i = 20; i > 0; i--) {
                    asm("nop\n");
                }
#if (DIGITS_NUMBER == 2)
        //SEG_1 = 0;
                SEG_PORT&= ~seg[1];
#endif
#endif
#if (DIGITS_NUMBER > 2)
            if(num/=10) {
                a= num%10;
                //SEG_1= 0;
                SEG_PORT&= ~seg[1];
#ifdef USE_EEPROM

#else
                shiftOut(numbers[a]);
#endif
                //SEG_2= 1;
                SEG_PORT|= seg[2];
                for (uint8_t i = 20; i > 0; i--) {
                    asm("nop\n");
                }
#if (DIGITS_NUMBER == 3)
                //SEG_2 = 0;
                SEG_PORT&= ~seg[2];
#endif
#endif
#if (DIGITS_NUMBER > 3)
            if(num/=10) {
                a= num%10;
                //SEG_2= 0;
                SEG_PORT&= ~seg[2];
#ifdef USE_EEPROM

#else
                shiftOut(numbers[a]);
#endif
                //SEG_3= 1;
                SEG_PORT|= seg[3];
                for (uint8_t i = 20; i > 0; i--) {
                    asm("nop\n");
                }
                //SEG_3= 0;
                SEG_PORT&= ~seg[3];
            }
            else {
                return;
            }
#endif
#if (DIGITS_NUMBER > 2)
            }
            else {
                return;
            }
#endif
#if (DIGITS_NUMBER > 1)
            }
            else {
                return;
            }
#endif
    for (uint8_t i= 20; i > 0; i--) {
        asm("nop\n");
    }
    
}
*/
void displayPrintESR(int16_t num) {
    if (digit_index == 0) {
        segm_flag= DIGIT;
        if (num < 0) {
            calc_var= (uint16_t)(0 - num);
            negative= 1;
        }
//.........这里部分代码省略.........
开发者ID:Disgust,项目名称:Segment-Display,代码行数:101,代码来源:SegmentDisplay.c


示例15: digitalWrite

void FU2_SO_Class::write(uint8_t b1, uint8_t b2, uint8_t b3)
{
    digitalWrite(_latchPin, LOW);
    shiftOut(_dataPin, _clockPin, MSBFIRST, b1);
    shiftOut(_dataPin, _clockPin, MSBFIRST, b2);
    shiftOut(_dataPin, _clockPin, MSBFIRST, b3);
    digitalWrite(_latchPin, HIGH);    
}
开发者ID:stevenlitt,项目名称:fu2_baby,代码行数:8,代码来源:FU2_SO_Class.cpp


示例16: shiftOut

void LedControl::spiTransfer(volatile uint8_t opcode, volatile uint8_t data) {
//  digitalWrite(10,LOW);
  PORTB &= ~_BV(PB2);
  shiftOut(opcode);
  shiftOut(data);
//  digitalWrite(10,HIGH);
  PORTB |= _BV(PB2);
}    
开发者ID:Tschibo00,项目名称:BadAssbasSSynth,代码行数:8,代码来源:MyLedControl.cpp


示例17: digitalWrite

//Funcion para mandar valores a la placa
void Matriz::imprimirPantalla(byte fila, byte columna){

    //Como usamos un regirtro de desplazamiento utilizamos la funcion shiftOut para enviarle los datos enviando primero el bit mas significativo
    digitalWrite(pinLatch, LOW);
    shiftOut(pinDatos, pinReloj, MSBFIRST, fila);
    shiftOut(pinDatos, pinReloj, MSBFIRST, columna);
    digitalWrite(pinLatch, HIGH);
}
开发者ID:Leantec,项目名称:KiwiBot,代码行数:9,代码来源:Matriz.cpp


示例18: shiftOut

void AD9850::update() {

    for (int i=0; i<4; i++, deltaphase>>=8) {
     shiftOut(DATA, W_CLK, LSBFIRST, deltaphase & 0xFF);
    }
    shiftOut(DATA, W_CLK, LSBFIRST, phase & 0xFF);
    pulse(FQ_UD);
}
开发者ID:F4GOJ,项目名称:AD9850,代码行数:8,代码来源:AD9850.cpp


示例19: WriteLEDs

void WriteLEDs(void) {
 // Now we write the actual values to the hardware
 shiftOut(LEDDataPin, LEDClockPin, MSBFIRST, Display3);
 shiftOut(LEDDataPin, LEDClockPin, MSBFIRST, Display2);
 shiftOut(LEDDataPin, LEDClockPin, MSBFIRST, Display1);
 digitalWrite(LEDStrobePin,HIGH);
 delay(2);
 digitalWrite(LEDStrobePin,LOW); 
 }
开发者ID:wwebb,项目名称:WordClock,代码行数:9,代码来源:wordclock+(buckeyeworldcitizen).c


示例20: digitalWrite

void DotDisplay::disablePins(){
	  byte secondbyte = B00000000;
	  byte firstbyte = B00000000;
	  
	  digitalWrite(_latchPin, LOW); 
	  shiftOut(_dataPin, _clockPin, MSBFIRST, firstbyte); 
	  shiftOut(_dataPin, _clockPin, MSBFIRST, secondbyte);  
	  digitalWrite(_latchPin, HIGH);
}
开发者ID:aacarioca,项目名称:FlipDotDisplayController,代码行数:9,代码来源:FlipDotDisplayController.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ shim函数代码示例发布时间:2022-05-30
下一篇:
C++ shift函数代码示例发布时间: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