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


C++ Adafruit_RGBLCDShield::readButtons方法代码示例

本文整理汇总了C++中Adafruit_RGBLCDShield::readButtons方法的典型用法代码示例。如果您正苦于以下问题:C++ Adafruit_RGBLCDShield::readButtons方法的具体用法?C++ Adafruit_RGBLCDShield::readButtons怎么用?C++ Adafruit_RGBLCDShield::readButtons使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Adafruit_RGBLCDShield的用法示例。


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

示例1: denaturization

void LCDScreen::denaturization()
{
  lcd.clear();
  lcd.setCursor( 0, 0 );
  lcd.print("Denaturization? ");
  lcd.setCursor( 0, 1 );
  lcd.print("Yes     No");
  lcd.setCursor( 0, 1 );
  lcd.blink();
  uint8_t buttons;
  while(true){
    buttons = lcd.readButtons();
    if (buttons & BUTTON_LEFT){
     lcd.setCursor( 0, 1 );
     denat = 1;
    }
    if (buttons & BUTTON_RIGHT){
     lcd.setCursor( 8, 1 );
     denat = 0;
    }
    if (buttons & BUTTON_SELECT){
     lcd.noBlink();
     break;
    }
  }
}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:26,代码来源:LCDScreen.cpp

示例2: selectCycles

void LCDScreen::selectCycles()
{
  dispUserPrefCycles();
  
  uint8_t buttons; 
  while ( true )
  {
    buttons = lcd.readButtons();
    if (buttons & BUTTON_LEFT) 
    {
      if ( maxCycles > 0 ) {
        maxCycles--;
        dispUserPrefCycles();
        delay(100);
      }
    }
    if (buttons & BUTTON_RIGHT) 
    {
      if ( maxCycles < 100 ) {
        maxCycles ++;
        dispUserPrefCycles();
        delay(100);
      }
    }
    if (buttons & BUTTON_SELECT) break;
  }
}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:27,代码来源:LCDScreen.cpp

示例3: selectHighLowPush

void LCDScreen::selectHighLowPush() {

  dispUserPrefHighLow();
  
  int highlow = 0;
  uint8_t buttons; 
  //int buttons;
 
  while ( true )
  {
    
    //buttons = bpin.readButtons();    
    //if (buttons & BPIN_UP) highlow = 0;  
    //if (buttons & BPIN_DOWN) highlow = 1;


    buttons = lcd.readButtons();

    if (buttons & BUTTON_UP) highlow = 0;  
    if (buttons & BUTTON_DOWN) highlow = 1;


    //if( buttons & BPIN_LEFT )
    if (buttons & BUTTON_LEFT) 
    {
      if ( highlow == 0 ) 
      {
        if ( tempCeil > ( tempFloor + 1 ) ) tempCeil--;
      }
      else
      {
        if ( tempFloor > 49 ) tempFloor--;
      }
      
      dispUserPrefHighLow();
      delay( 100 );
    }
    
    //if( buttons & BPIN_RIGHT )
    if (buttons & BUTTON_RIGHT) 
    {
      if ( highlow == 0 )
      {
        if ( tempCeil < 110 ) tempCeil++;
      }
      else 
      {
        if ( tempFloor < ( tempCeil - 1 ) ) tempFloor++;
      }
      
      dispUserPrefHighLow();
      delay( 100 );
    }

    //if( buttons & BPIN_SELECT )
    if (buttons & BUTTON_SELECT) break;
     
  }
}
开发者ID:C-O-S-M-E-D,项目名称:Thermocycler,代码行数:59,代码来源:LCDScreen.cpp

示例4: main

int main(int argc, char *argv[])
{
	Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
	
	lcd.begin(16, 2);

	lcd.setBacklight(RED);
	lcd.clear();
	lcd.home();
	lcd.setCursor(0,0);
	lcd.myPrint("Hello World");
	
	int count = 0;
	for(int i = 0; i < 20; i++){
		usleep(300000);
		if(count < 5){
			lcd.scrollDisplayRight();
		}
		count++;
		if(count > 5){
			lcd.scrollDisplayLeft();
		}
		if(count > 9) count = 0;
	}
	
	uint8_t buttons = lcd.readButtons();

	while(!(buttons & BUTTON_SELECT)){
		if (buttons) {
			if (buttons & BUTTON_LEFT) {
				lcd.scrollDisplayLeft();
				lcd.setBacklight(GREEN);
			}
			if (buttons & BUTTON_RIGHT) {
				lcd.scrollDisplayRight();
				lcd.setBacklight(TEAL);
			}
		}
		buttons = lcd.readButtons();
		usleep(90000);
    }
    
	return 0;
}
开发者ID:Mikejr88,项目名称:LCDPiPlate,代码行数:44,代码来源:main.cpp

示例5: waitForSelect

void LCDScreen::waitForSelect()
{
  while ( true )
  {
    uint8_t buttons = lcd.readButtons();
    
    if ( buttons )
    {
      if (buttons & BUTTON_SELECT) break;
    }
  }
}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:12,代码来源:LCDScreen.cpp


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