- 29a Bùi Xuân Phái, P.Tây Thạnh, Quận Tân Phú, TPHCM
- linhkienduchuy2018@gmail.com
- TƯ VẤN, GIẢI ĐÁP, HƯỚNG DẪN, MUA HÀNG (ZALO): 0966515049 - 0942954739
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.
THÔNG SỐ KỸ THUÂT
VCC | 3.3V |
GND | Ground |
SDA | Serial Data Line |
SCL | Serial Clock Line |
CS | Chip selection, low active |
DC | Data/Command selection (high for data, low for command) |
RST | Reset, 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);
}
}
}
2,000₫
3,000₫
70,000₫
5,000₫
42,000₫
48,000₫
80,000₫
85,000₫
100,000₫
4,000₫
40,000₫
13,000₫
28,000₫
2,000₫
23,000₫
25,000₫
50,000₫
70,000₫
6,000₫
6,000₫
7,000₫
5,000₫
8,000₫
13,000₫
3,000₫
120,000₫
120,000₫
120,000₫
120,000₫
120,000₫
120,000₫
120,000₫
45,000₫
25,000₫
25,000₫
25,000₫
Bình luận