Tft.fillScreen()

From Microduino Wiki
Revision as of 03:41, 18 July 2016 by Fengfeng (talk) (Created page with "<pre style="color:green"> tft.fillScreen(uint16_t color) </pre> *'''Effect''':<br> Use color to fulfill the whole screen. *'''Parameter''':<br> color:fill color *'''Exa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
tft.fillScreen(uint16_t color)
  • Effect:

Use color to fulfill the whole screen.


  • Parameter:

color:fill color


  • Example:
#define sclk 13
#define mosi 11
#define cs   5
#define dc   4
#define rst  -1  // you can also connect this to the Arduino reset

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

#if defined(__SAM3X8E__)
    #undef __FlashStringHelper::F(string_literal)
    #define F(string_literal) string_literal
#endif

Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst);

void setup(void) {
  tft.initR(INITR_BLACKTAB);   // initialize a ST7735S chip, black tab
  tft.fillScreen(ST7735_YELLOW);
}

void loop() {  }


[Return TFT_ST7735 Grammar Handbook]