Difference between revisions of "Tft.setTextSize()"

From Microduino Wiki
Jump to: navigation, search
 
Line 43: Line 43:
  
  
[[https://wiki.microduino.cc/index.php/TFT_ST7735_Grammar_Handbook Return to TFT_ST7735 Grammar Handbook]]
+
[[https://wiki.microduino.cc/index.php/TFT_ST7735_Syntax_Manual Return to TFT_ST7735 Syntax Manual]]

Latest revision as of 03:35, 4 August 2016

tft.setTextSize(uint8_t s)
  • Effect:

Set the size of the letters printed on the TFT screen.


  • Parameter:

s:the size of the letters 0/1/2


  • 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_BLACK);
  tft.setCursor(10, 40);
  tft.setTextColor(ST7735_YELLOW);
  tft.setTextSize(0);
  tft.println("Hello World!");
}

void loop() {  }


[Return to TFT_ST7735 Syntax Manual]