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


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

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


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

示例1: testlines

void testlines(uint16_t color) {
    tft.fillScreen(ST7735_BLACK);
    for (int16_t x=0; x < tft.width(); x+=6) {
        tft.drawLine(0, 0, x, tft.height()-1, color);
    }
    for (int16_t y=0; y < tft.height(); y+=6) {
        tft.drawLine(0, 0, tft.width()-1, y, color);
    }

    tft.fillScreen(ST7735_BLACK);
    for (int16_t x=0; x < tft.width(); x+=6) {
        tft.drawLine(tft.width()-1, 0, x, tft.height()-1, color);
    }
    for (int16_t y=0; y < tft.height(); y+=6) {
        tft.drawLine(tft.width()-1, 0, 0, y, color);
    }

    tft.fillScreen(ST7735_BLACK);
    for (int16_t x=0; x < tft.width(); x+=6) {
        tft.drawLine(0, tft.height()-1, x, 0, color);
    }
    for (int16_t y=0; y < tft.height(); y+=6) {
        tft.drawLine(0, tft.height()-1, tft.width()-1, y, color);
    }

    tft.fillScreen(ST7735_BLACK);
    for (int16_t x=0; x < tft.width(); x+=6) {
        tft.drawLine(tft.width()-1, tft.height()-1, x, 0, color);
    }
    for (int16_t y=0; y < tft.height(); y+=6) {
        tft.drawLine(tft.width()-1, tft.height()-1, 0, y, color);
    }
}
开发者ID:ubirch,项目名称:ubirch-thgs,代码行数:33,代码来源:tft.cpp

示例2: drawGUI

void drawGUI() {
    tft.fillScreen(ST7735_BLACK);
    tft.setCursor(0,70);
    dualPrint("Play a game?");
    dualPrint("<Press Joystick>");
    lcd_image_draw(&logoImage, &tft, 0, 0, 30, 10, 100, 50);
}
开发者ID:tpavlek,项目名称:arduitron,代码行数:7,代码来源:tron.cpp

示例3: testfillrects

void testfillrects(uint16_t color1, uint16_t color2) {
    tft.fillScreen(ST7735_BLACK);
    for (int16_t x=tft.width()-1; x > 6; x-=6) {
        tft.fillRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color1);
        tft.drawRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color2);
    }
}
开发者ID:ubirch,项目名称:ubirch-thgs,代码行数:7,代码来源:tft.cpp

示例4: loop

void loop() {
    Serial.println("printing though!");
    tft.fillScreen(ST7735_BLACK);
    // tft.setCursor(0, 0);
    tft.setTextColor(ST7735_WHITE);
    tft.setTextWrap(true);
    // tft.setTextSize(3);
    // tft.setCursor(30, 3);
    tft.setFont(HERO_10);
    tft.drawRightString("OTTAWA",  3);

    tft.setFont(HERO_16);
    tft.setTextSize(2);
    // tft.setCursor(25, 20);
    tft.drawRightString("-1  C", 20);

    tft.setTextSize(1);
    // tft.setCursor(35, 60);
    tft.drawRightString("2:35 PM", 60);

    tft.drawFastHLine(0, 90, tft.width(), ST7735_CYAN);

    tft.setTextWrap(true);
    tft.setFont(CENTURY_8);
    tft.setTextSize(1);
    // tft.setCursor(0, tft.height()-65);
    int yPos = tft.drawString("Stay Hungry, Stay Foolish!",  0,tft.height()-65);
    tft.setTextColor(ST7735_CYAN);
    tft.drawRightString(" - Steve Jobs   ", yPos);
    tft.setTextColor(ST7735_MAGENTA);
    delay(5000);
}
开发者ID:Trekky12,项目名称:Adafruit_ST7735,代码行数:32,代码来源:example.cpp

示例5: setup

void setup() {
// start the spi bus
#ifdef hal_spi
  SPI.begin();
#endif
#ifdef hal_tft
  lcd.initR(INITR_BLACKTAB);   // initialize a ST7735S chip, black tab
  lcd.fillScreen(ST7735_BLACK);
#endif
  // initialize serial port
  Serial.begin(9600);
  // leonardo - wait for connection
  while(!Serial) { }
#ifdef TwoWire_h
  // start the i2C bus
  Wire.begin();
#endif
#ifdef hal_raster
  Raster.start();
#endif
#ifdef hal_compass
  compass.start();
#endif
  // start the droid filesystem (now we have serial)
  droid.fs.start();
  // center the joystick
#ifdef hal_tft
  droid.joystick[0].center = 1024 - analogRead(A1);
  droid.joystick[1].center = analogRead(A2);
#endif
  // droid.joystick_center[0] = 1024 - analogRead(A1);
  // droid.joystick_center[1] = analogRead(A2);
}
开发者ID:fuinha,项目名称:unorthodox-arduino,代码行数:33,代码来源:droid-beeps.cpp

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

示例7: main_display

void main_display(void) {
  tft.fillScreen(BLACK);
  tft.setFont(&FreeSans9pt7b);
  // Show mid screen tune position
  tft.drawFastVLine(80, 0, 60, RED);
  show_s_meter_layout();
}
开发者ID:AgriVision,项目名称:Teensy_SDR,代码行数:7,代码来源:display.cpp

示例8: init

void init()
{
	spiffs_mount(); // Mount file system, in order to work with files

	Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
	Serial.systemDebugOutput(true); // Allow debug output to serial

	//WifiStation.config(WIFI_SSID, WIFI_PWD);
	WifiStation.enable(false);
//	WifiAccessPoint.enable(false);

	debugf("Display start");
	startTime = millis();

	// Use this initializer if you're using a 1.8" TFT
	// tft.initR(INITR_BLACKTAB);   // initialize a ST7735S chip, black tab

	// Use this initializer (uncomment) if you're using a 1.44" TFT
	tft.initR(INITR_144GREENTAB);   // initialize a ST7735S chip, black tab

	tft.fillScreen(ST7735_BLACK);
	startTime = millis() - startTime;

	debugf("Initialized in %d ms\n", startTime);

	DemoScreenTimer.initializeMs(500, screen1).start(FALSE);

}
开发者ID:BorntraegerMarc,项目名称:SmingRTOS,代码行数:28,代码来源:application.cpp

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

示例10: screen1

void screen1() {
	startTime = millis();
    // large block of text
    tft.fillScreen(ST7735_BLACK);
    testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", ST7735_WHITE);
	debugf("screen1: testdrawtext %d ms", millis() - startTime);
	DemoScreenTimer.initializeMs(1000, screen2).start(FALSE);
}
开发者ID:BorntraegerMarc,项目名称:SmingRTOS,代码行数:8,代码来源:application.cpp

示例11: screen8

void screen8() {
	startTime = millis();
	tft.fillScreen(ST7735_BLACK);
	testfillcircles(10, ST7735_BLUE);
	testdrawcircles(10, ST7735_WHITE);
	debugf("screen8: testfillcircles %d ms", millis() - startTime);
	DemoScreenTimer.initializeMs(1000, screen9).start(FALSE);
}
开发者ID:BorntraegerMarc,项目名称:SmingRTOS,代码行数:8,代码来源:application.cpp

示例12: setup

void setup() {
	Serial.begin(9600);

	// initialise display
	tft.initR(INITR_BLACKTAB);
	tft.fillScreen(ST7735_BLACK);

	// initialise pins
	pinMode(leftPin, INPUT);
	pinMode(rightPin, INPUT);
	pinMode(turnPin, INPUT);
	
	// display splashscreen
	tft.setTextColor(ST7735_WHITE);
	tft.setTextWrap(true);
	
	tft.setCursor(34, 20);
	tft.println("WELCOME TO");
	
	tft.setCursor(45, 30);
	tft.println("~TETRIS");
	
	tft.setCursor(16, 50);
	tft.println("PRESS THE MIDDLE");
	
	tft.setCursor(18, 60);
	tft.println("BUTTON TO START");

	tft.setCursor(57, 110);
	tft.println("BY:");

	tft.setCursor(33, 120);
	tft.println("NICHOLAS LI");

	tft.setCursor(56, 130);
	tft.println("AND");

	tft.setCursor(24, 140);
	tft.println("ARJUN KALBURGI");

	// only continue if turnPin is pressed
	while(digitalRead(turnPin) == LOW) {}

	tft.fillScreen(ST7735_BLACK);
}
开发者ID:askalburgi,项目名称:Arduino_Tetris,代码行数:45,代码来源:tetris.cpp

示例13: testfastlines

void testfastlines(uint16_t color1, uint16_t color2) {
    tft.fillScreen(ST7735_BLACK);
    for (int16_t y=0; y < tft.height(); y+=5) {
        tft.drawFastHLine(0, y, tft.width(), color1);
    }
    for (int16_t x=0; x < tft.width(); x+=5) {
        tft.drawFastVLine(x, 0, tft.height(), color2);
    }
}
开发者ID:ubirch,项目名称:ubirch-thgs,代码行数:9,代码来源:tft.cpp

示例14: setup

void setup() {
    
    Serial.begin(9600);

    tft.initG();
     
    tft.fillScreen(ST7735_BLACK);


}
开发者ID:Trekky12,项目名称:Adafruit_ST7735,代码行数:10,代码来源:example.cpp

示例15: displayGrid

void displayGrid() {
    tft.fillScreen(0x0000);    // clear the screen with black
    tft.setCursor(0,0);        // set the cursor, indicates where to display
    tft.setTextWrap(false);    // no wrap
   

    tft.print("\n THREES! PUZZLE GAME  \n\n");
    tft.print("      SCORE: ");
    tft.print(score);
    tft.print("\n");


    if (plus) {
        tft.print("            +");
        tft.print(plus);
        tft.print("\n\n");
    }
    else {
        tft.print(" ");
        tft.print("\n\n");
    }

    for(int i=0;i<4;i++) {
        tft.print("  |");

        for(int j=0;j<4;j++) {
            if(grid[i][j]) {
                // use sapce " " to make the interface clear since a number with more digits occupies more space
                if(grid[i][j] < 10) {
                    tft.print(" ");
                    tft.print(grid[i][j]);
                    tft.print(" |");
                }
                else if (grid[i][j] >= 10 && grid[i][j] < 100) {
                    tft.print("");
                    tft.print(grid[i][j]);
                    tft.print(" |");
                }
                else {
                    tft.print("");
                    tft.print(grid[i][j]);
                    tft.print("|");
                }
               
               
            }
            else {
                tft.print(" ");
                tft.print(" ");
                tft.print(" |");
            }
        }
        tft.print("\n\n");
    }
}
开发者ID:TongTongX,项目名称:CPPStudyCode,代码行数:55,代码来源:ThreesProject.cpp


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