This file contains hidden or 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
| /* | |
| Web client | |
| This sketch connects to a website (http://www.google.com) | |
| using an Arduino WIZnet Ethernet shield. | |
| Circuit: | |
| * Ethernet shield attached to pins 10, 11, 12, 13 | |
| created 18 Dec 2009 |
This file contains hidden or 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
| /* ArtronShop : www.ArtronShop.co.th */ | |
| #define SIGNAL_PIN (2) // ขาที่ต่อเครื่องรับเหรียญ | |
| #define COIN_VALUE (10) // กำหนดเหรียญที่ใส่ในเครื่อง เพื่อให้คำนวณยอดเงินถูกต้อง | |
| int count = 0; // ตัวแปรนับ Pulse ที่เครื่องรับเหรียญส่งเข้ามา | |
| bool count_update_flag = false; // ตัวแปรเก็บค่าว่า count อัพเดทแล้ว | |
| void setup() { | |
| Serial.begin(9600); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) |