This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ATD1.47-S3.h> | |
#include <Wire.h> | |
#include <Adafruit_AMG88xx.h> | |
//low range of the sensor (this will be blue on the screen) | |
#define MINTEMP 22 | |
//high range of the sensor (this will be red on the screen) | |
#define MAXTEMP 34 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <lvgl.h> | |
#include <ATD3.5-S3.h> | |
#include "gui/ui.h" | |
#include "driver/gpio.h" | |
#include "driver/twai.h" | |
#define CAN_TX_PIN GPIO_NUM_1 | |
#define CAN_RX_PIN GPIO_NUM_2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <mcp2515.h> | |
MCP2515 mcp2515(10); | |
void setup() { | |
Serial.begin(115200); | |
mcp2515.reset(); | |
mcp2515.setBitrate(CAN_125KBPS, MCP_8MHZ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <lvgl.h> | |
#include <ATD3.5-S3.h> | |
#include "gui/ui.h" | |
#include <WiFi.h> | |
#include <PubSubClient.h> | |
#define MQTT_SERVER "mqtt.netpie.io" | |
#define MQTT_PORT 1883 | |
#define MQTT_CLIENT_ID "58dd3ff2-33e7-4203-8a83-528b65076fd9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ModbusMaster.h> | |
#define RS485_RX_PIN (15) | |
#define RS485_TX_PIN (17) | |
#define RS485_DIR_PIN (16) | |
ModbusMaster sensor; | |
void preTransmission() { | |
digitalWrite(RS485_DIR_PIN, HIGH); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <lvgl.h> | |
#include <ATD3.5-S3.h> | |
#include "gui/ui.h" | |
#include <PMS.h> | |
PMS pms(Serial2); | |
PMS::DATA data; | |
bool pms_ok = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* TMP36 analog temperature sensor with Arduino example code. More info: https://www.makerguides.com */ | |
// Define to which pin of the Arduino the output of the TMP36 is connected: | |
#define sensorPin A0 | |
void setup() { | |
// Begin serial communication at a baud rate of 9600: | |
Serial.begin(9600); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define RXD2 (16) // กำหนดขา RX ของ Serial2 เป็นขา 16 | |
#define TXD2 (17) // กำหนดขา TX ของ Serial2 เป็นขา 17 | |
void setup() { | |
Serial.begin(115200); // เริ่มต้นใช้งาน Serial0 ที่ความเร็ว (baud rate) 115200 | |
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2); // เริ่มต้นใช้งาน Serial2 ที่ความเร็ว (baud rate) 9600 พร้อมกำหนดขา RX, TX ใหม่ | |
} | |
void loop() { | |
while (Serial.available()) { // วนลูปหากมีข้อมูลเข้ามาจาก Serial0 (จาก Serial Monitor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define RXD1 (25) // กำหนดขา RX ของ Serial1 เป็นขา 25 | |
#define TXD1 (26) // กำหนดขา TX ของ Serial1 เป็นขา 26 | |
void setup() { | |
Serial.begin(115200); // เริ่มต้นใช้งาน Serial0 ที่ความเร็ว (baud rate) 115200 | |
Serial1.begin(9600, SERIAL_8N1, RXD1, TXD1); // เริ่มต้นใช้งาน Serial1 ที่ความเร็ว (baud rate) 9600 พร้อมกำหนดขา RX, TX ใหม่ | |
} | |
void loop() { | |
while (Serial.available()) { // วนลูปหากมีข้อมูลเข้ามาจาก Serial0 (จาก Serial Monitor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <TFT_eSPI.h> | |
#include <FT6336U.h> | |
TFT_eSPI tft = TFT_eSPI(); | |
FT6336U tp; | |
void setup() { | |
Serial.begin(115200); | |
pinMode(14, OUTPUT); |