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


C++ Adafruit_ST7735::setRotation方法代码示例

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


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

示例1: setup

void setup() {
    Serial.begin(9600);
    Serial1.begin(9600);
    tft.initR(INITR_REDTAB);
    randomSeed(analogRead(4));
    joystickXCentre = analogRead(JOYSTICK_MOVE_X_PIN) - 512;
    joystickYCentre = analogRead(JOYSTICK_MOVE_Y_PIN) - 512;
    pinMode(JOYSTICK_BUTTON_PIN, INPUT_PULLUP);
    pinMode(COUNTDOWN_START_RED_1, OUTPUT);
    pinMode(COUNTDOWN_START_RED_2, OUTPUT);
    pinMode(COUNTDOWN_MID_RED_1, OUTPUT);
    pinMode(COUNTDOWN_MID_RED_2, OUTPUT);
    pinMode(COUNTDOWN_GREEN, OUTPUT);
    tft.setRotation(1); //because our screen is nonstandard rotation
    player1.score = 0;
    player2.score = 0;
    if (!SD.begin(SD_CS)) {
        Serial.println("SD Init Failed");
        return;
    }
    if (!card.init(SPI_HALF_SPEED, SD_CS)) {
        Serial.println("Raw SD Init failed");
        while (1);
    }
    tft.fillScreen(ST7735_BLACK);
}
开发者ID:tpavlek,项目名称:arduitron,代码行数:26,代码来源:tron.cpp

示例2: screen13

void screen13() {
	startTime = millis();
	debugf("screen13: bmpDraw rotaton %d ms", millis() - startTime);
	tft.fillScreen(ST7735_BLACK); // Clear display
	tft.setRotation(tft.getRotation() + 1); // Inc rotation 90 degrees
	for (uint8_t i = 0; i < 4; i++)    // Draw 4 parrots
		bmpDraw(tft, "sming.bmp", tft.width() / 4 * i, tft.height() / 4 * i);
}
开发者ID:BorntraegerMarc,项目名称:SmingRTOS,代码行数:8,代码来源:application.cpp

示例3: setup_display

void setup_display(void) {
  
  // initialize the LCD display
//  tft.init();
//  tft.initR(INITR_BLACKTAB);   // initialize a S6D02A1S chip, black tab
  tft.setRotation(1);
  tft.fillScreen(BLACK); //BLACK);
  //tft.fillRect(0, pos, 160, 128-pos, BLACK); // erase old string
  tft.setCursor(0, 119);
  tft.setTextColor(WHITE);
  tft.setTextWrap(true);
//  tft.print("DD4WH SDR 5.00");
  
  // Show mid screen tune position
  tft.drawFastVLine(pos_centre_f, 0,pos+1, RED); //WHITE);
 // tft.drawFastHLine(0, pos,79, YELLOW);// WHITE);
  //tft.drawFastHLine(81, pos,79, YELLOW);

// draw S-Meter layout
  tft.drawFastHLine (pos_x_smeter, pos_y_smeter-1, 9*s_w, WHITE);
  tft.drawFastHLine (pos_x_smeter, pos_y_smeter+3, 9*s_w, WHITE);
  tft.fillRect(pos_x_smeter, pos_y_smeter-3, 2, 2, WHITE);
  tft.fillRect(pos_x_smeter+8*s_w, pos_y_smeter-3, 2, 2, WHITE);
  tft.fillRect(pos_x_smeter+2*s_w, pos_y_smeter-3, 2, 2, WHITE);
  tft.fillRect(pos_x_smeter+4*s_w, pos_y_smeter-3, 2, 2, WHITE);
  tft.fillRect(pos_x_smeter+6*s_w, pos_y_smeter-3, 2, 2, WHITE);
  tft.fillRect(pos_x_smeter+7*s_w, pos_y_smeter-4, 2, 3, WHITE);
  tft.fillRect(pos_x_smeter+3*s_w, pos_y_smeter-4, 2, 3, WHITE);
  tft.fillRect(pos_x_smeter+5*s_w, pos_y_smeter-4, 2, 3, WHITE);
  tft.fillRect(pos_x_smeter+s_w, pos_y_smeter-4, 2, 3, WHITE);
  tft.fillRect(pos_x_smeter+9*s_w, pos_y_smeter-4, 2, 3, WHITE);
  tft.drawFastHLine (pos_x_smeter+9*s_w, pos_y_smeter-1, 3*s_w*2+2, GREEN);
  tft.drawFastHLine (pos_x_smeter+9*s_w, pos_y_smeter+3, 3*s_w*2+2, GREEN);
  tft.fillRect(pos_x_smeter+11*s_w, pos_y_smeter-4, 2, 3, GREEN);
  tft.fillRect(pos_x_smeter+13*s_w, pos_y_smeter-4, 2, 3, GREEN);
  tft.fillRect(pos_x_smeter+15*s_w, pos_y_smeter-4, 2, 3, GREEN);
  tft.drawFastVLine (pos_x_smeter-1, pos_y_smeter-1, 5, WHITE); 
  tft.drawFastVLine (pos_x_smeter+15*s_w+2, pos_y_smeter-1, 5, GREEN);

  tft.setCursor(pos_x_smeter - 4, pos_y_smeter - 13);
  tft.setTextColor(WHITE);
  tft.setTextWrap(true);
  tft.print("S 1");
  tft.setCursor(pos_x_smeter + 28, pos_y_smeter - 13);
  tft.print("3");
  tft.setCursor(pos_x_smeter + 48, pos_y_smeter - 13);
  tft.print("5");
  tft.setCursor(pos_x_smeter + 68, pos_y_smeter - 13);
  tft.print("7");
  tft.setCursor(pos_x_smeter + 88, pos_y_smeter - 13);
  tft.print("9");
  tft.setCursor(pos_x_smeter + 120, pos_y_smeter - 13);
  tft.print("+20dB");

} // end void setupdisplay
开发者ID:DD4WH,项目名称:Teensy-SDR-Rx,代码行数:55,代码来源:display.cpp

示例4: initialize_screen

void initialize_screen() {

    tft.initR(INITR_REDTAB);

    tft.setRotation(0);

    tft.setCursor(0, 0);
    tft.setTextColor(0x0000);
    tft.setTextSize(1);
    tft.fillScreen(BLUE);    
}
开发者ID:elake,项目名称:assignment3,代码行数:11,代码来源:client.cpp

示例5: setup_display

void setup_display(void) {
  // initialize the LCD display
  tft.initR(INITR_BLACKTAB);   // initialize a S6D02A1S chip, black tab
  tft.setRotation(1);
  tft.fillScreen(BLACK);
}
开发者ID:AgriVision,项目名称:Teensy_SDR,代码行数:6,代码来源:display.cpp


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