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 <Wire.h> | |
| #include <Adafruit_GFX.h> | |
| #include "Adafruit_LEDBackpack.h" | |
| Adafruit_7segment matrix = Adafruit_7segment(); | |
| int hours = 12; | |
| int minutes = 0; | |
| int seconds = 0; |
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 <Wire.h> | |
| #include <Adafruit_GFX.h> | |
| #include "Adafruit_LEDBackpack.h" | |
| // สร้างออบเจ็กต์จอ 7-Segment | |
| Adafruit_7segment matrix = Adafruit_7segment(); | |
| void setup() { | |
| Serial.begin(9600); | |
| Serial.println("7-Segment Test"); |
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 <WiFi.h> | |
| #include <WiFiMulti.h> | |
| #include <Wire.h> | |
| #include <time.h> | |
| #include <ArtronShop_RX8130CE.h> | |
| #include <ESP32-HUB75-MatrixPanel-I2S-DMA.h> | |
| #define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module. | |
| #define PANEL_RES_Y 32 // Number of pixels tall of each INDIVIDUAL panel module. |
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 <WiFi.h> | |
| #include <WiFiMulti.h> | |
| #include "time.h" | |
| #include <Wire.h> | |
| #include <ESP32-HUB75-MatrixPanel-I2S-DMA.h> | |
| #define PANEL_RES_X 64 // Number of pixels wide of each INDIVIDUAL panel module. | |
| #define PANEL_RES_Y 32 // Number of pixels tall of each INDIVIDUAL panel module. | |
| #define PANEL_CHAIN 1 // Total number of panels chained one to another |
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
| /* | |
| * Adafruit MCP2515 FeatherWing CAN Sender Example | |
| */ | |
| #include <Adafruit_MCP2515.h> | |
| #define CS_PIN 10 | |
| #define CAN_BAUDRATE (250000) | |
| Adafruit_MCP2515 mcp(CS_PIN); |
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 (27) | |
| #define RS485_TX_PIN (26) | |
| ModbusMaster sensor; | |
| void setup() { | |
| Serial.begin(115200); |
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 <WiFi.h> | |
| #include <TinkerC6.h> | |
| #include <ModbusMaster.h> | |
| #include <PubSubClient.h> | |
| #include "esp_pm.h" | |
| #include "esp_wifi.h" | |
| #include "driver/uart.h" | |
| #include "soc/uart_struct.h" |
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 <TinkerC6.h> | |
| #include <ModbusMaster.h> | |
| ModbusMaster sensor; | |
| void setup() { | |
| Serial.begin(115200); | |
| // Enable I2C Power Output (Sensor ON) | |
| TinkerC6.Power.enable12V(); |
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
| /* | |
| Basic ESP8266 MQTT example | |
| This sketch demonstrates the capabilities of the pubsub library in combination | |
| with the ESP8266 board/library. | |
| It connects to an MQTT server then: | |
| - publishes "hello world" to the topic "outTopic" every two seconds | |
| - subscribes to the topic "inTopic", printing out any messages | |
| it receives. NB - it assumes the received payloads are strings not binary | |
| - If the first character of the topic "inTopic" is an 1, switch ON the ESP Led, | |
| else switch it off |
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 <TinkerC6.h> // เรียกใช้ไลบรารี่ Tinker C6 | |
| void setup() { | |
| Serial.begin(115200); // เริ่มใช้งาน Serial Monitor | |
| TinkerC6.Power.enable12V(); // สั่งเปิดใช้ไฟเลี้ยง 12V | |
| } | |
| void loop() { | |
| float mA = TinkerC6.Analog.getCurrent(); // อ่านค่าช่อง 4-20mA เก็บลงตัวแปร mA | |
| Serial.printf("Analog is %.02f mA\n", mA); // แสดงผลค่าใน Serial Monitor |