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


C++ TFT::begin方法代码示例

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


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

示例1: clockSetup

// Init the clock modules
void ClockMaster::clockSetup(Alarm *alarm) {
  Serial.begin(9600);
  initRTC();
  dht.begin();
  tft.begin();
  initScreen();
  alarm->initAlarm(getTime());
}
开发者ID:IdarV,项目名称:Arduino,代码行数:9,代码来源:ClockMaster.cpp

示例2: init

void Board::init(){
  // Start screen
  TFTscreen.begin();
  // make the background black
  TFTscreen.background(0, 0, 0);

  // Set starting colors
  rgbColour[0] = 255;
  rgbColour[1] = 0;
  rgbColour[2] = 0;

  // Set which color to be incremented and decremented
  decColour = 0;
  incColour = 1;

  TFTscreen.stroke(255, 255, 255);
  // Draw top border left->right
  TFTscreen.line(boardBorderXLeft, boardBorderYTop, boardBorderXRight, boardBorderYTop);
  // Draw right border top->bottom
  TFTscreen.line(boardBorderXLeft, boardBorderYTop, boardBorderXLeft, boardBoarderYBottom);
  // Draw bottom border left->right
  TFTscreen.line(boardBorderXLeft, boardBoarderYBottom, boardBorderXRight, boardBoarderYBottom);
  // Draw left border
  TFTscreen.line(boardBorderXRight, boardBorderYTop, boardBorderXRight, boardBoarderYBottom);

  // Write score
  TFTscreen.setCursor(10, 10);
  TFTscreen.setTextSize(1);
  TFTscreen.print(score_str);
  setScore(0);

  // Write highscore
  TFTscreen.setTextSize(1);
  TFTscreen.stroke(255, 255, 255);
  TFTscreen.setCursor(10, 50);
  TFTscreen.print(high_str);
  TFTscreen.setCursor(10, 60);
  TFTscreen.print(score_str);
}
开发者ID:IdarV,项目名称:Arduino,代码行数:39,代码来源:board.cpp

示例3: readLine

PadConfiguration::PadConfiguration(const char* fileName):
  _valid(false),
  _picture(nullptr)
{
Serial.println("[PadConfiguration start]");
  if(!TFTInit)
  {
    TFTscreen.begin();
    TFTInit = true;
  }
  for(uint8_t index; index < BUTTON_ARRAY_SIZE; ++index)
  {
    _mapping[index] = nullptr;
  }

  File myFile;
  myFile = SD.open(fileName);

  if(!myFile)
  {
    Serial.println("[PadConfiguration done: could not open file]");
    return;
  }

  String padConf = readLine(myFile);

  Serial.println(padConf.c_str());

  Serial.println(padConf.length());

  if(padConf.length() != BUTTON_ARRAY_SIZE*2+1)
  {
    Serial.println("[PadConfiguration done: parse error length]");
    Serial.println(padConf.length());
    myFile.close();
    return;
  }

  for(uint8_t index = 0; index < BUTTON_ARRAY_SIZE; ++index)
  {
    switch(padConf.charAt(index*2))
    {
      case 'k':
      {
        _mapping[index] = new InputHandlerKeyboard(padConf.charAt(index*2+1), false, false);
        if(!_mapping[index]->_valid)
        {
          Serial.println("[PadConfiguration done: parse error k]");
          myFile.close(); return;
        }
        break;
      }
      case 'K':
      {
        _mapping[index] = new InputHandlerKeyboard(padConf.charAt(index*2+1), true, false);
        if(!_mapping[index]->_valid)
        {
          Serial.println("[PadConfiguration done: parse error K]");
          myFile.close(); return;
        }
        break;
      }
      case 'F':
      {
        _mapping[index] = new InputHandlerKeyboard(padConf.charAt(index*2+1), false, true);
        if(!_mapping[index]->_valid)
        {
          Serial.println("[PadConfiguration done: parse error F]");
          myFile.close(); return;
        }
        break;
      }
      case 'P':
      {
        _mapping[index] = new InputHandlerPad(padConf.charAt(index*2+1));
        if(!_mapping[index]->_valid)
        {
          Serial.println("[PadConfiguration done: parse error P]");
          myFile.close(); return;
        }
        break;
      }
      case 'X':
      /*{
        _mapping[index] = new InputHandlerDualShock3(padConf.charAt(index*2+1));
        if(!_mapping[index]->_valid)
        {
          Serial.println("[PadConfiguration done: parse error X]");
          myFile.close(); return;
        }
        break;
      }*/
      case '-':
      {
        _mapping[index] = nullptr;
        break;
      }
      default:
      {myFile.close(); Serial.println("[PadConfiguration done: parse error]"); return;}
    }
//.........这里部分代码省略.........
开发者ID:alban-rochel,项目名称:pixstick,代码行数:101,代码来源:PadConfiguration.cpp


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