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


C++ Adafruit_RGBLCDShield类代码示例

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


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

示例1: 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

示例2: dispUserPrefCycles

void LCDScreen::dispUserPrefCycles()
{
  lcd.clear();
  lcd.setCursor( 0, 0 );
  lcd.print( "# of cycles: " );
  lcd.setCursor( 0, 15 );
  lcd.print( maxCycles );
}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:8,代码来源:LCDScreen.cpp

示例3: finalMess

void LCDScreen::finalMess()
{
  lcd.clear();
  lcd.home();
  lcd.print( "PCR complete." );
  lcd.setCursor( 0, 1 );
  lcd.print( "RESET to cont." );

}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:9,代码来源:LCDScreen.cpp

示例4: setup

void LCDScreen::setup() {

  lcd.begin( 16, 2 );
  lcd.home();
  lcd.print( "PCR V.2 - O.V.L.");
  lcd.setCursor( 0, 1 );
  lcd.print( "SELECT to cont." );
  waitForSelect();  
  delay( 500 );
  setUserInputs();
  delay( 500 );

}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:13,代码来源:LCDScreen.cpp

示例5: printError

void LCDScreen::printError( int mess )
{
  lcd.clear();
  lcd.home();
  
  String message;
  if ( mess == 1 ) { message = "ERR: Overheating"; }
  else if ( mess < 1 ) { message = "ERR: Not ramping"; }
  else { message = "ERR: wrap failed"; }

  lcd.print( message );

  lcd.setCursor( 0, 1 );
  lcd.print( "Check hardware" );
}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:15,代码来源:LCDScreen.cpp

示例6: 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

示例7: 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

示例8: setUserInputs

void LCDScreen::setUserInputs()
{
  lcd.clear();
  // Check for Denaturization
  denaturization();
  delay(500);
  lcd.clear();

  // Adjust High/Low Values
  int highlow = 0;
  
  selectHighLowPush();
  delay(500);
  // Adjust No. of Cycles
  selectCycles();
  delay(500);
  // All done with configuration
}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:18,代码来源:LCDScreen.cpp

示例9:

void K3NGdisplay::redraw(){

  // redraw the screen with the current screen_buffer_live

  for (int x = 0;x < (display_columns*display_rows);x++){   
    lcd.setCursor(Xposition(x),Yposition(x));
    if (screen_buffer_attributes_live[x] & ATTRIBUTE_BLINK){  // does this character have the blink attribute
      if (current_blink_state){
        lcd.print(screen_buffer_live[x]);
      } else {
        lcd.print(' ');
      }
    } else {
      lcd.print(screen_buffer_live[x]);
    }
  }


}	
开发者ID:nayobz,项目名称:k3ng_rotator_controller,代码行数:19,代码来源:k3ngdisplay.cpp

示例10: clear

void K3NGdisplay::initialize(){


  lcd.begin(display_columns, display_rows);  // if you are getting an error on this line and do not have
                                             // any of the LCD display features enabled, remove
                                             // k3ngdisplay.h and k3ngdisplay.cpp from your ino directory

  #ifdef FEATURE_YOURDUINO_I2C_LCD
  lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);
  lcd.setBacklight(I2C_LCD_COLOR);
  #endif // FEATURE_YOURDUINO_I2C_LCD

  #ifdef FEATURE_ADAFRUIT_I2C_LCD
  lcd.setBacklight(I2C_LCD_COLOR);
  #endif // FEATURE_ADAFRUIT_I2C_LCD

  clear();


}
开发者ID:nayobz,项目名称:k3ng_rotator_controller,代码行数:20,代码来源:k3ngdisplay.cpp

示例11: 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

示例12: updateArrow

void LCDScreen::updateArrow( double temp )
{
  lcd.home();
  lcd.print( tempFloor );
  
  if ( temp < tempFloor ) temp = tempFloor;
  
  int n; //number of spaces to create
  if ( tempFloor > 99 && tempCeil > 99 ) n = 9;
  else if ( tempFloor > 99 && tempCeil <= 99 ) n = 10;
  else if ( tempFloor <= 99 && tempCeil > 99 ) n = 10;
  else n = 11;  
  
  int newTemp = map( temp, tempFloor, tempCeil, 0, n );
  
  for ( int o = 0; o < newTemp; o++ )
  {
    lcd.print( "-" );
  }
  lcd.print( ">" );
  for ( int o = 0; o < ( n - newTemp); o++ )
  {
    lcd.print( " " );
  }

  lcd.print( tempCeil );
}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:27,代码来源:LCDScreen.cpp

示例13: dispUserPrefHighLow

void LCDScreen::dispUserPrefHighLow()
{
  lcd.clear();
  lcd.home();
  lcd.print( "High: " );
  lcd.print( tempCeil );
  lcd.setCursor( 0, 1 );
  lcd.print( "Low:  " );
  lcd.print( tempFloor );
}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:10,代码来源:LCDScreen.cpp

示例14: displayInitialStatus

void LCDScreen::displayInitialStatus( double temp, int current_cycle ) {

  lcd.clear();
  lcd.home();
  
  updateArrow( temp );
  
  lcd.setCursor( 0, 1 );
  lcd.print( "Cycle no. " );
  lcd.print( current_cycle );
  lcd.print( "/" );
  lcd.print( maxCycles );


}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:15,代码来源:LCDScreen.cpp

示例15: dispDenatStatus

void LCDScreen::dispDenatStatus(long int currentTime, long int stopTime)
{
  int minLeft;
  lcd.clear();
  lcd.setCursor( 0, 1 );
  if(currentTime == 0 && stopTime == 0){
    lcd.print("Ramping Up");
  }
  else{
  minLeft = (stopTime - currentTime) / 60000;
  lcd.print(minLeft);
  lcd.setCursor(2,1);
  lcd.print("min left");  
  }
    
}
开发者ID:dr-data,项目名称:Thermocycler-III,代码行数:16,代码来源:LCDScreen.cpp


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