本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例14: setup
void setup() {
Serial.begin(9600);
tft.initG();
tft.fillScreen(ST7735_BLACK);
}
示例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");
}
}