Difference between revisions of "Tft.drawFastHLine()"

From Microduino Wiki
Jump to: navigation, search
(Created page with "<pre style="color:green"> tft.drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) </pre> *'''Effect''':<br> Draw a horizontal line on the TFT screen.<br> *'''Par...")
 
 
(One intermediate revision by one other user not shown)
Line 46: Line 46:
  
  
[[http://wiki.microduino.cc/index.php/TFT_ST7735%E8%AF%AD%E6%B3%95%E6%89%8B%E5%86%8C Return 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:31, 4 August 2016

tft.drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
  • Effect:

Draw a horizontal line on the TFT screen.


  • Parameters:

x:the x coordinate of the starting point

y:the y coordinate of the starting point

w:the length of the horizontal line

color:color of the line


  • 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.drawFastHLine(10, 80, 100, ST7735_YELLOW);
}

void loop() {  }


[Return to TFT_ST7735 Syntax Manual]