当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Arduino TFT - point()用法及代码示例


说明

在给定坐标处绘制一个点。第一个参数是点的水平值,第二个值是点的垂直值。

用法

screen.point(xPos, yPos);

参数

xPos: int, 点的水平位置 yPos: int, 点的垂直位置

返回

示例

#include <SPI.h>
#include <TFT.h>            // Arduino TFT library

#define cs   10
#define dc   9
#define rst  8

TFT screen = TFT(cs, dc, rst);

void setup() {
  // initialize the screen
  screen.begin();

  // make the background black
  screen.background(0,0,0);

  // set the stroke color to white
  screen.fill(255,255,255);

  // draw a pixel in the screen's center
  screen.point(screen.width()/2, screen.height()/2);
}

void loop() {

}

相关用法


注:本文由纯净天空筛选整理自arduino.cc大神的英文原创作品 TFT - point()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。