Khác

MÀN HÌNH TFT 2.0" (240x320) 3.3V

Mã sản phẩm: K7_21
THÔNG SỐ KỸ THUÂTTrình điều khiển: ST7789VGiao diện: SPIMàu hiển thị: RGB, 262K màuĐộ phân giải: 240×320Đèn nền: LEDĐiện áp hoạt động: 3.3VCÁCH KẾT NỐI TFT VỚI ARDUINO VCC - 3.3VGND - GNDSDA - D11SCL - D13CS - D10DC - D8RST - D9 MÔ TẢ CHÂN VCC  3.3V GNDGroundSDASerial Data LineSCLSerial Clock LineCSChip selection, low...
145,000₫
Hàng còn: 4
Số lượng
 
1
 
Thêm vào giỏ Mua ngay

Dịch vụ & Khuyến mãi

Giao miễn phí chuyển phát nhanh trong nội thành TPHCM đối với đơn hàng trên 1 triệu đồng

Giảm 5k cho đơn hàng trên 300k đồng

Giảm 10k cho đơn hàng trên 500k đồng

Giảm 15k hoặc freeship chuyển phát nhanh cho đơn hàng trên 1tr đồng

Giảm 25.000đ hoặc freeship cho đơn hàng trên 2tr đồng.

Chi tiết sản phẩm

THÔNG SỐ KỸ THUÂT

  • Trình điều khiển: ST7789V
  • Giao diện: SPI
  • Màu hiển thị: RGB, 262K màu
  • Độ phân giải: 240×320
  • Đèn nền: LED
  • Điện áp hoạt động: 3.3V
CÁCH KẾT NỐI TFT VỚI ARDUINO
 
VCC - 3.3V
GND - GND
SDA - D11
SCL - D13
CS - D10
DC - D8
RST - D9

 

MÔ TẢ CHÂN 
VCC  3.3V 
GNDGround
SDASerial Data Line
SCLSerial Clock Line
CSChip selection, low active
DCData/Command selection (high for data, low for command)
RSTReset, low active

CODE TEST SẢN PHẨM:

#include <Adafruit_GFX.h>    

#include <Adafruit_ST7789.h>

#include <SPI.h>

  #define TFT_CS        10 //CS

  #define TFT_RST        9 //RST

  #define TFT_DC         8 //DC

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

#define TFT_MOSI 11  // SDA

#define TFT_SCLK 13  // SCL

void setup(void) {

  Serial.begin(9600);

  Serial.print(F("Hello! ST77xx TFT Test"));

  tft.init(240, 320);           // Init ST7789 240x240

  Serial.println(F("Initialized"));

  uint16_t time = millis();

  tft.fillScreen(ST77XX_BLACK);

  time = millis() - time;

  Serial.println(time, DEC);

  delay(500);

  tft.drawPixel(tft.width()/2, tft.height()/2, ST77XX_GREEN);

  delay(500);

  testfastlines(ST77XX_RED, ST77XX_BLUE);

  delay(500);

  testdrawrects(ST77XX_GREEN);

  delay(500);

  testfillrects(ST77XX_YELLOW, ST77XX_MAGENTA);

  delay(500);

  tft.fillScreen(ST77XX_BLACK);

  testfillcircles(10, ST77XX_BLUE);

  testdrawcircles(10, ST77XX_WHITE);

  delay(500);

}

 

void loop() {

  tft.invertDisplay(true);

  delay(500);

  tft.invertDisplay(false);

  delay(500);

}

 

void testdrawtext(char *text, uint16_t color) {

  tft.setCursor(0, 0);

  tft.setTextColor(color);

  tft.setTextWrap(true);

  tft.print(text);

}

 

void testfastlines(uint16_t color1, uint16_t color2) {

  tft.fillScreen(ST77XX_BLACK);

  for (int16_t y=0; y < tft.height(); y+=5) {

    tft.drawFastHLine(0, y, tft.width(), color1);

  }

  for (int16_t x=0; x < tft.width(); x+=5) {

    tft.drawFastVLine(x, 0, tft.height(), color2);

  }

}

 

void testdrawrects(uint16_t color) {

  tft.fillScreen(ST77XX_BLACK);

  for (int16_t x=0; x < tft.width(); x+=6) {

    tft.drawRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color);

  }

}

 

void testfillrects(uint16_t color1, uint16_t color2) {

  tft.fillScreen(ST77XX_BLACK);

  for (int16_t x=tft.width()-1; x > 6; x-=6) {

    tft.fillRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color1);

    tft.drawRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color2);

  }

}

 

void testfillcircles(uint8_t radius, uint16_t color) {

  for (int16_t x=radius; x < tft.width(); x+=radius*2) {

    for (int16_t y=radius; y < tft.height(); y+=radius*2) {

      tft.fillCircle(x, y, radius, color);

    }

  }

}

 

void testdrawcircles(uint8_t radius, uint16_t color) {

  for (int16_t x=0; x < tft.width()+radius; x+=radius*2) {

    for (int16_t y=0; y < tft.height()+radius; y+=radius*2) {

      tft.drawCircle(x, y, radius, color);

    }

  }

}


 

 

Bình luận

Không có sản phẩm nào trong giỏ hàng của bạn

Không có sản phẩm nào trong giỏ hàng của bạn

LINH KIỆN ĐIỆN TỬ ĐỨC HUY (29A BÙI XUÂN PHÁI)
LINH KIỆN ĐIỆN TỬ ĐỨC HUY (29A BÙI XUÂN PHÁI)