Tft.drawFastVLine()
1196357542(讨论 | 贡献)2016年7月13日 (三) 05:38的版本
tft.drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
- 作用:
在TFT屏幕上画出一条竖线
- 参数:
x:起始点x轴坐标
y:起始点y轴坐标
w:竖线长度
color:线的颜色
- 例子:
#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.drawFastVLine(60, 20, 100, ST7735_RED);
}
void loop() { }