“Tft.drawFastHLine()”的版本间的差异

来自Microduino Wikipedia
跳转至: 导航搜索
 
第1行: 第1行:
<pre style="color:green">
+
<br>
tft.drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)
+
<p style="color: #666666;font-size:220%">'''tft.drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)'''</p>
</pre>
+
<br>
  
*'''作用''':<br>
+
<p style="color: #E87E05;font-size:135%">'''作用'''</p>
 
在TFT屏幕上画出一条横线<br>
 
在TFT屏幕上画出一条横线<br>
  
  
*'''参数''':<br>
+
<p style="color: #E87E05;font-size:135%">'''参数'''</p>
 
x:起始点x轴坐标
 
x:起始点x轴坐标
  
第17行: 第17行:
  
  
*'''例子''':<br>
+
<p style="color: #E87E05;font-size:135%">'''示例'''</p>
<pre style="color:green">
+
<source lang="cpp">
#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_GFX.h>    // Core graphics library
 
#include <Adafruit_ST7735.h> // Hardware-specific library
 
#include <Adafruit_ST7735.h> // Hardware-specific library
 
#include <SPI.h>
 
#include <SPI.h>
  
#if defined(__SAM3X8E__)
+
#define TFT_CS    D5
    #undef __FlashStringHelper::F(string_literal)
+
#define TFT_RST    -1  // you can also connect this to the Arduino reset
    #define F(string_literal) string_literal
+
#define TFT_DC    D4
#endif
+
 
 +
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS,  TFT_DC, TFT_RST);
  
Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, mosi, sclk, rst);
 
  
 
void setup(void) {
 
void setup(void) {
第42行: 第36行:
 
}
 
}
  
void loop() { }
+
void loop(){
</pre>
+
}
 +
</source>
 +
 
  
  
[[http://wiki.microduino.cn/index.php/TFT_ST7735%E8%AF%AD%E6%B3%95%E6%89%8B%E5%86%8C/zh 返回TFT_ST7735语法手册]]
+
[[Microduino-Module_TFT_Reference|返回TFT_ST7735编程手册界面]]

2018年5月16日 (三) 08:26的最新版本


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


作用

在TFT屏幕上画出一条横线


参数

x:起始点x轴坐标

y:起始点y轴坐标

w:横线长度

color:线的颜色


示例

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

#define TFT_CS     D5
#define TFT_RST    -1  // you can also connect this to the Arduino reset
#define TFT_DC     D4

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS,  TFT_DC, TFT_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(){
}


返回TFT_ST7735编程手册界面