ใช้หน้าจอ 1.8 TFT LCD ST7735S โปรแกรมรันผ่านหมดแต่ภาพไม่มีอะไรขึ้น ต่อถูกกทุกอย่างทั้งโค้ดและสาย แต่ยังจอขาวไม่อะไรขึ้นอยู่ ต้องใช้อะไรหรือป่าวครับ
ต่อถูกกทุกอย่างทั้งโค้ดและสาย แต่ยังจอขาวไม่อะไรขึ้นอยู่ ต้องใช้อะไรหรือป่าวครับ
ขอวิธีต่อหน่อยครับ ของ บอร์ด Mega 2560 R3 กับ TFT 1.8 LCD ผมลองต่อตาม Uno ไม่ได้ผมไม่เข้าใจ
ยังไม่ได้เลยครับผมลองตามรูปนี้แล้วด้าน
http://www.mx7.com/i/671/K304Tq.png
ส่วนโค้ด
#include <Hx711.h>
#include <TFT.h> // Arduino LCD library
#include <SPI.h>
#define cs 10
#define dc 9
#define rst 8
TFT TFTscreen = TFT(cs, dc, rst);
Hx711 scale(A1, A0);
char WeightPrintout[5];
char WeightPrintoutold[5];
float dat_g;
void setup() {
Serial.begin(9600);
TFTscreen.begin();
TFTscreen.background(255, 255, 255);
TFTscreen.background(0, 0, 0);
// write the static text to the screen
// set the font color to white
TFTscreen.stroke(255,255,125);
// set the font size
TFTscreen.setTextSize(2);
// write the text to the top left corner of the screen
TFTscreen.text(" Load cell\n ",5,5);
TFTscreen.setTextSize(1);
TFTscreen.stroke(255,255,255);
TFTscreen.text("Taipe's Arduino\n ",35,25);
TFTscreen.setTextSize(2);
TFTscreen.stroke(255,255,255);
TFTscreen.text("g.",130,70);
//blue green Red
TFTscreen.stroke(125,255,0);
TFTscreen.text("Hx711 Module\n ",10,100);
TFTscreen.setTextSize(5);
}
void loop() {
dat_g=scale.getGram();
Serial.print(dat_g, 1);
Serial.println(" g");
TFTscreen.stroke(0,0,0);
TFTscreen.text(WeightPrintoutold, 10, 50);
String BPM_St=String(int(dat_g));
BPM_St.toCharArray(WeightPrintout, 5);
TFTscreen.stroke(255,255,255);
TFTscreen.text(WeightPrintout, 10, 50);
BPM_St.toCharArray(WeightPrintoutold, 5);
}
รบกวนต่อเป็นตัวอย่างให้หน่อยครับผมลองหลายวิธีละ
ต่อขาไม่ถูกอันนั้นเป็นของ atmega16u2 เป็นชิฟ usb serial ไม่ใช่ชิฟ arduino mega 2560
ขา spi ตามนี้นะครับ