คือปัญหาตัวนี้เกิดจากอะไรหรอครับ ผมโหลดไลบารี่ มาเเล้วนะครับ
/* sample for digital weight scale of hx711, display with a HD44780 liquid crtstal monitor
*
* hardware design: syyyd
* available at http://syyyd.taobao.com
*
* library design: Weihong Guan (@aguegu)
* http://aguegu.net
*
* library host on
* https://github.com/aguegu/Arduino
*/
// Hx711.DOUT - pin #A1
// Hx711.SCK - pin #A0
#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);
}
คอมไพล์ไม่ผ่านครับ น่าจะยังลงไลบารีไม่ถูก ลองเช็คอีกครั้งครับ