Skip to content

Instantly share code, notes, and snippets.

View maxpromer's full-sized avatar

Max maxpromer

View GitHub Profile
#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;
#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");
#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.
#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
/*
* Adafruit MCP2515 FeatherWing CAN Sender Example
*/
#include <Adafruit_MCP2515.h>
#define CS_PIN 10
#define CAN_BAUDRATE (250000)
Adafruit_MCP2515 mcp(CS_PIN);
#include <ModbusMaster.h>
#define RS485_RX_PIN (27)
#define RS485_TX_PIN (26)
ModbusMaster sensor;
void setup() {
Serial.begin(115200);
#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"
#include <TinkerC6.h>
#include <ModbusMaster.h>
ModbusMaster sensor;
void setup() {
Serial.begin(115200);
// Enable I2C Power Output (Sensor ON)
TinkerC6.Power.enable12V();
/*
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
#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